Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2294#discussion_r17704445
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/linalg/BLAS.scala ---
    @@ -197,4 +201,368 @@ private[mllib] object BLAS extends Serializable {
             throw new IllegalArgumentException(s"scal doesn't support vector 
type ${x.getClass}.")
         }
       }
    +
    +  // For level-3 routines, we use the native BLAS.
    +  private def nativeBLAS: NetlibBLAS = {
    +    if (_nativeBLAS == null) {
    +      _nativeBLAS = NativeBLAS
    +    }
    +    _nativeBLAS
    +  }
    +
    +  /**
    +   * C := alpha * A * B + beta * C
    +   * @param transA specify whether to use matrix A, or the transpose of 
matrix A. Should be "N" or
    +   *               "n" to use A, and "T" or "t" to use the transpose of A.
    +   * @param transB specify whether to use matrix B, or the transpose of 
matrix B. Should be "N" or
    +   *               "n" to use B, and "T" or "t" to use the transpose of B.
    +   * @param alpha a scalar to scale the multiplication A * B.
    +   * @param A the matrix A that will be left multiplied to B. Size of m x 
k.
    +   * @param B the matrix B that will be left multiplied by A. Size of k x 
n.
    +   * @param beta a scalar that can be used to scale matrix C.
    +   * @param C the resulting matrix C. Size of m x n.
    +   */
    +  def gemm(
    +      transA: Boolean,
    +      transB: Boolean,
    +      alpha: Double,
    +      A: Matrix,
    +      B: DenseMatrix,
    +      beta: Double,
    +      C: DenseMatrix): Unit = {
    +    if (alpha == 0.0) {
    +      logWarning("gemm: alpha is equal to 0. Returning C.")
    --- End diff --
    
    `gemm` maybe called many times and there are cases when `alpha` is indeed 
zero. Maybe we can change it to `logDebug` to avoid outputting many log 
messages at a normal level.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to