tf.sparse_matmul
tf.sparse_matmul
tf.sparse_matmul
sparse_matmul( a, b, transpose_a=None, transpose_b=None, a_is_sparse=None, b_is_sparse=None, name=None )
Defined in tensorflow/python/ops/gen_math_ops.py
.
Multiply matrix "a" by matrix "b".
The inputs must be two-dimensional matrices and the inner dimension of "a" must match the outer dimension of "b". This op is optimized for the case where at least one of "a" or "b" is sparse. The breakeven for using this versus a dense matrix multiply on one platform was 30% zero values in the sparse matrix.
Args:
-
a
: ATensor
. Must be one of the following types:float32
,bfloat16
. -
b
: ATensor
. Must be one of the following types:float32
,bfloat16
. -
transpose_a
: An optionalbool
. Defaults toFalse
. -
transpose_b
: An optionalbool
. Defaults toFalse
. -
a_is_sparse
: An optionalbool
. Defaults toFalse
. -
b_is_sparse
: An optionalbool
. Defaults toFalse
. -
name
: A name for the operation (optional).
Returns:
A Tensor
of type float32
.
© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/sparse_matmul