tensorflow:: אופס:: SparseMatMul
#include <math_ops.h>
הכפל את המטריצה "a" במטריצה "b".
תַקצִיר
התשומות חייבות להיות מטריצות דו מימדיות והממד הפנימי של "a" חייב להתאים לממד החיצוני של "b". גם "a" וגם "b" חייבים להיות Tensor
ולא SparseTensor
s. אופציה זו מותאמת למקרה שבו לפחות אחד מ-"a" או "b" הוא דליל, במובן שיש להם חלק גדול של ערכים אפס. האיזון לשימוש זה לעומת כפל מטריצה צפופה בפלטפורמה אחת היה 30% מערכי אפס במטריצה הדלילה.
חישוב השיפוע של פעולה זו ינצל את הדלילות בשיפוע הקלט רק כאשר שיפוע זה מגיע מ- Relu .
טיעונים:
החזרות:
תכונות ציבוריות
מִבצָע
Operation operation
מוּצָר
::tensorflow::Output product
תפקידים ציבוריים
SparseMatMul
SparseMatMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input a,
::tensorflow::Input b
)
SparseMatMul
SparseMatMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input a,
::tensorflow::Input b,
const SparseMatMul::Attrs & attrs
)
צוֹמֶת
::tensorflow::Node * node() const
operator::tensorflow::Input() const
אופרטור::tensorflow::פלט
operator::tensorflow::Output() const
פונקציות סטטיות ציבוריות
AIsSparse
Attrs AIsSparse(
bool x
)
BIsSparse
Attrs BIsSparse(
bool x
)
TransposeA
Attrs TransposeA(
bool x
)
TransposeB
Attrs TransposeB(
bool x
)
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-27 (שעון UTC)."],[],[],null,["# tensorflow::ops::SparseMatMul Class Reference\n\ntensorflow::ops::SparseMatMul\n=============================\n\n`#include \u003cmath_ops.h\u003e`\n\n[Multiply](/versions/r2.2/api_docs/cc/class/tensorflow/ops/multiply#classtensorflow_1_1ops_1_1_multiply) matrix \"a\" by matrix \"b\".\n\nSummary\n-------\n\nThe 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 [Tensor](/versions/r2.2/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor)s not `SparseTensor`s. 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.\n\nThe gradient computation of this operation will only take advantage of sparsity in the input gradient when that gradient comes from a [Relu](/versions/r2.2/api_docs/cc/class/tensorflow/ops/relu#classtensorflow_1_1ops_1_1_relu).\n\nArguments:\n\n- scope: A [Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The product tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SparseMatMul](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1a44ec3b9c8a4a6c27ec1e5defa921a8c2)`(const ::`[tensorflow::Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` a, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` b)` ||\n| [SparseMatMul](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1a29e8ca18f70b1f18d2d5931606fa5108)`(const ::`[tensorflow::Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` a, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` b, const `[SparseMatMul::Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/sparse-mat-mul/attrs#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1af4bedc3c3ba71553d0c1e30513898430) | [Operation](/versions/r2.2/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [product](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1a9b708969f18250faa3e40edad285ae45) | `::`[tensorflow::Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|--------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1ae461c34d275e4d996e21af14b8870531)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1a7e6d0d764e73510a120ea967abaf9250)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1a3fee7729e51d2b640d654a25a84f0185)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| [AIsSparse](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1acaa26e8e9d1e5854dcfef57dcb4efd5b)`(bool x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/sparse-mat-mul/attrs#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs) |\n| [BIsSparse](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1aaf87a4805b8269233969a514bea852ef)`(bool x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/sparse-mat-mul/attrs#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs) |\n| [TransposeA](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1a41b864162f17688227aa34ee4d8021b2)`(bool x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/sparse-mat-mul/attrs#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs) |\n| [TransposeB](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1af58949ad4394aa0ba7869e65ba742487)`(bool x)` | [Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/sparse-mat-mul/attrs#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs) |\n\n| ### Structs ||\n|---------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::SparseMatMul::Attrs](/versions/r2.2/api_docs/cc/struct/tensorflow/ops/sparse-mat-mul/attrs) | Optional attribute setters for [SparseMatMul](/versions/r2.2/api_docs/cc/class/tensorflow/ops/sparse-mat-mul#classtensorflow_1_1ops_1_1_sparse_mat_mul). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### product\n\n```text\n::tensorflow::Output product\n``` \n\nPublic functions\n----------------\n\n### SparseMatMul\n\n```gdscript\n SparseMatMul(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input a,\n ::tensorflow::Input b\n)\n``` \n\n### SparseMatMul\n\n```gdscript\n SparseMatMul(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input a,\n ::tensorflow::Input b,\n const SparseMatMul::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### AIsSparse\n\n```text\nAttrs AIsSparse(\n bool x\n)\n``` \n\n### BIsSparse\n\n```text\nAttrs BIsSparse(\n bool x\n)\n``` \n\n### TransposeA\n\n```text\nAttrs TransposeA(\n bool x\n)\n``` \n\n### TransposeB\n\n```text\nAttrs TransposeB(\n bool x\n)\n```"]]