จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: เบาบางMatMul
#include <math_ops.h>
คูณ เมทริกซ์ "a" ด้วยเมทริกซ์ "b"
สรุป
อินพุตต้องเป็นเมทริกซ์สองมิติ และมิติภายในของ "a" จะต้องตรงกับมิติภายนอกของ "b" ทั้ง "a" และ "b" ต้องเป็น Tensor
ไม่ใช่ SparseTensor
s op นี้ได้รับการปรับให้เหมาะสมสำหรับกรณีที่ "a" หรือ "b" อย่างน้อยหนึ่งตัวมีกระจัดกระจาย ในแง่ที่ว่าพวกมันมีค่าเป็นศูนย์ในสัดส่วนที่สูง จุดคุ้มทุนสำหรับการใช้สิ่งนี้เทียบกับการคูณเมทริกซ์หนาแน่นบนแพลตฟอร์มเดียวคือ 30% ค่าศูนย์ในเมทริกซ์แบบกระจาย
การคำนวณการไล่ระดับสีของการดำเนินการนี้จะใช้ประโยชน์จากความกระจัดกระจายในการไล่ระดับสีอินพุตเท่านั้น เมื่อการไล่ระดับสีนั้นมาจาก Relu
ข้อโต้แย้ง:
ผลตอบแทน:
คุณลักษณะสาธารณะ
งานสาธารณะ
โหนด
::tensorflow::Node * node() const
operator::tensorflow::Input() const
ตัวดำเนินการ::tensorflow::เอาต์พุต
operator::tensorflow::Output() const
ฟังก์ชันคงที่สาธารณะ
AIsเบาบาง
Attrs AIsSparse(
bool x
)
BIsSparse
Attrs BIsSparse(
bool x
)
ย้ายA
Attrs TransposeA(
bool x
)
ทรานโพสบี
Attrs TransposeB(
bool x
)
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[],[],null,["# tensorflow::ops::SparseMatMul Class Reference\n\ntensorflow::ops::SparseMatMul\n=============================\n\n`#include \u003cmath_ops.h\u003e`\n\n[Multiply](/versions/r2.0/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.0/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.0/api_docs/cc/class/tensorflow/ops/relu#classtensorflow_1_1ops_1_1_relu).\n\nArguments:\n\n- scope: A [Scope](/versions/r2.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.0/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.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` a, ::`[tensorflow::Input](/versions/r2.0/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.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` a, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` b, const `[SparseMatMul::Attrs](/versions/r2.0/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.0/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.0/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.0/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.0/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.0/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.0/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.0/api_docs/cc/struct/tensorflow/ops/sparse-mat-mul/attrs) | Optional attribute setters for [SparseMatMul](/versions/r2.0/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```"]]