Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
dòng chảy căng:: ôi:: MatMul
#include <math_ops.h>
Nhân ma trận "a" với ma trận "b".
Bản tóm tắt
Dữ liệu đầu vào phải là ma trận hai chiều và chiều bên trong của "a" (sau khi được chuyển đổi nếu transpose_a là đúng) phải khớp với chiều bên ngoài của "b" (sau khi được chuyển đổi nếu transpose_b là đúng).
Lưu ý : Việc triển khai kernel mặc định cho MatMul trên GPU sử dụng cublas.
Lập luận:
Thuộc tính tùy chọn (xem Attrs
):
- transpose_a: Nếu đúng, "a" được chuyển vị trước khi nhân.
- transpose_b: Nếu đúng, "b" được chuyển vị trước khi nhân.
Trả về:
Thuộc tính công khai
Chức năng công cộng
nút
::tensorflow::Node * node() const
operator::tensorflow::Input() const
toán tử::tenorflow::Đầu ra
operator::tensorflow::Output() const
Các hàm tĩnh công khai
Chuyển vịA
Attrs TransposeA(
bool x
)
Chuyển đổiB
Attrs TransposeB(
bool x
)
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# tensorflow::ops::MatMul Class Reference\n\ntensorflow::ops::MatMul\n=======================\n\n`#include \u003cmath_ops.h\u003e`\n\n[Multiply](/versions/r2.3/api_docs/cc/class/tensorflow/ops/multiply#classtensorflow_1_1ops_1_1_multiply) the matrix \"a\" by the matrix \"b\".\n\nSummary\n-------\n\nThe inputs must be two-dimensional matrices and the inner dimension of \"a\" (after being transposed if transpose_a is true) must match the outer dimension of \"b\" (after being transposed if transposed_b is true).\n\n*Note* : The default kernel implementation for [MatMul](/versions/r2.3/api_docs/cc/class/tensorflow/ops/mat-mul#classtensorflow_1_1ops_1_1_mat_mul) on GPUs uses cublas.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/mat-mul/attrs#structtensorflow_1_1ops_1_1_mat_mul_1_1_attrs)):\n\n- transpose_a: If true, \"a\" is transposed before multiplication.\n- transpose_b: If true, \"b\" is transposed before multiplication.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The product tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [MatMul](#classtensorflow_1_1ops_1_1_mat_mul_1ab83040fb6ae9e56138c0f69b00760209)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` a, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` b)` ||\n| [MatMul](#classtensorflow_1_1ops_1_1_mat_mul_1a34177e68c8f4fa1f1813814ce67d891c)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` a, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` b, const `[MatMul::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/mat-mul/attrs#structtensorflow_1_1ops_1_1_mat_mul_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_mat_mul_1ab873d083b82c9aa9485a303d40b97eb4) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [product](#classtensorflow_1_1ops_1_1_mat_mul_1ab034be60cd7ec86407eb741bdfc5f379) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_mat_mul_1a0336cd912c0b25144c3d9b57a626debf)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_mat_mul_1abd3e6b08fb374614d203378c1dfaec97)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_mat_mul_1a9882a2914eeb6bb488bf990e3240f05a)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|\n| [TransposeA](#classtensorflow_1_1ops_1_1_mat_mul_1adde997ec4038167a5e5e31ad805e2651)`(bool x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/mat-mul/attrs#structtensorflow_1_1ops_1_1_mat_mul_1_1_attrs) |\n| [TransposeB](#classtensorflow_1_1ops_1_1_mat_mul_1a94996492e8e4ff12164accf93c28dabd)`(bool x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/mat-mul/attrs#structtensorflow_1_1ops_1_1_mat_mul_1_1_attrs) |\n\n| ### Structs ||\n|--------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::MatMul::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/mat-mul/attrs) | Optional attribute setters for [MatMul](/versions/r2.3/api_docs/cc/class/tensorflow/ops/mat-mul#classtensorflow_1_1ops_1_1_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### MatMul\n\n```gdscript\n MatMul(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input a,\n ::tensorflow::Input b\n)\n``` \n\n### MatMul\n\n```gdscript\n MatMul(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input a,\n ::tensorflow::Input b,\n const MatMul::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### TransposeA\n\n```text\nAttrs TransposeA(\n bool x\n)\n``` \n\n### TransposeB\n\n```text\nAttrs TransposeB(\n bool x\n)\n```"]]