#include <math_ops.h>
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". Both "a" and "b" must be Tensors not SparseTensors. This op is optimized for the case where at least one of "a" or "b" is sparse, in the sense that they have a large proportion of zero values. The breakeven for using this versus a dense matrix multiply on one platform was 30% zero values in the sparse matrix.
The gradient computation of this operation will only take advantage of sparsity in the input gradient when that gradient comes from a Relu.
Arguments:
Returns:
Output: The product tensor. | Constructors and Destructors | |
|---|---|
SparseMatMul(const ::tensorflow::Scope & scope, ::tensorflow::Input a, ::tensorflow::Input b) | |
SparseMatMul(const ::tensorflow::Scope & scope, ::tensorflow::Input a, ::tensorflow::Input b, const SparseMatMul::Attrs & attrs) |
| Public attributes | |
|---|---|
operation | |
product | |
| Public functions | |
|---|---|
node() const | ::tensorflow::Node * |
operator::tensorflow::Input() const | |
operator::tensorflow::Output() const | |
| Public static functions | |
|---|---|
AIsSparse(bool x) | |
BIsSparse(bool x) | |
TransposeA(bool x) | |
TransposeB(bool x) | |
| Structs | |
|---|---|
| tensorflow::ops::SparseMatMul::Attrs | Optional attribute setters for SparseMatMul. |
Operation operation
::tensorflow::Output product
SparseMatMul( const ::tensorflow::Scope & scope, ::tensorflow::Input a, ::tensorflow::Input b )
SparseMatMul( const ::tensorflow::Scope & scope, ::tensorflow::Input a, ::tensorflow::Input b, const SparseMatMul::Attrs & attrs )
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output() const
Attrs AIsSparse( bool x )
Attrs BIsSparse( bool x )
Attrs TransposeA( bool x )
Attrs TransposeB( bool x )
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.4/api_docs/cc/class/tensorflow/ops/sparse-mat-mul