تدفق التوتر:: العمليات:: SparsMatMul
#include <math_ops.h>
اضرب المصفوفة "أ" في المصفوفة "ب".
ملخص
يجب أن تكون المدخلات مصفوفات ثنائية الأبعاد ويجب أن يتطابق البعد الداخلي لـ "أ" مع البعد الخارجي لـ "ب". يجب أن يكون كل من "a" و"b" Tensor
وليس SparseTensor
s. تم تحسين هذه العملية للحالة التي يكون فيها واحد على الأقل من "a" أو "b" متناثرًا، بمعنى أن لديهم نسبة كبيرة من القيم الصفرية. وكان التعادل لاستخدام هذا مقابل مصفوفة كثيفة تتضاعف على منصة واحدة هو 30٪ من القيم الصفرية في المصفوفة المتفرقة.
لن يستفيد حساب التدرج لهذه العملية إلا من التشتت في تدرج الإدخال عندما يأتي هذا التدرج من Relu .
الحجج:
العوائد:
الصفات العامة
عملية
Operation operation
منتج
::tensorflow::Output product
الوظائف العامة
SparsMatMul
SparseMatMul(
const ::tensorflow::Scope & scope,
::tensorflow::Input a,
::tensorflow::Input b
)
SparsMatMul
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
)
تبديل أ
Attrs TransposeA(
bool x
)
تبديل ب
Attrs TransposeB(
bool x
)
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# tensorflow::ops::SparseMatMul Class Reference\n\ntensorflow::ops::SparseMatMul\n=============================\n\n`#include \u003cmath_ops.h\u003e`\n\n[Multiply](/versions/r1.15/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/r1.15/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/r1.15/api_docs/cc/class/tensorflow/ops/relu#classtensorflow_1_1ops_1_1_relu).\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/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/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` a, ::`[tensorflow::Input](/versions/r1.15/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/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` a, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` b, const `[SparseMatMul::Attrs](/versions/r1.15/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/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [product](#classtensorflow_1_1ops_1_1_sparse_mat_mul_1a9b708969f18250faa3e40edad285ae45) | `::`[tensorflow::Output](/versions/r1.15/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/r1.15/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/r1.15/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/r1.15/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/r1.15/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/r1.15/api_docs/cc/struct/tensorflow/ops/sparse-mat-mul/attrs) | Optional attribute setters for [SparseMatMul](/versions/r1.15/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```"]]