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:: Thưa thớtDày đặcCwiseThêm
#include <sparse_ops.h>
Cộng một SparseTensor và một Tensor dày đặc bằng cách sử dụng các quy tắc đặc biệt sau:
Bản tóm tắt
(1) Phát sóng phía dày đặc có hình dạng giống với phía thưa thớt, nếu đủ điều kiện; (2) Sau đó, chỉ các giá trị dày đặc được chỉ ra bởi các chỉ số của SparseTensor mới tham gia vào phép cộng cwise.
Theo các quy tắc này, kết quả là một SparseTensor logic có cùng chỉ số và hình dạng, nhưng có thể có các giá trị khác 0. Đầu ra của Op này là các giá trị khác 0.
Lập luận:
- phạm vi: Một đối tượng phạm vi
- sp_indices: 2-D. Ma trận
N x R
với các chỉ số của các giá trị không trống trong SparseTensor, có thể không theo thứ tự chuẩn. - giá trị sp: 1-D.
N
giá trị không trống tương ứng với sp_indices
. - sp_shape: 1-D. Hình dạng của SparseTensor đầu vào.
- đậm đặc:
R
-D. Toán hạng Tensor dày đặc.
Trả về:
-
Output
: 1-D. Các giá trị N
được vận hành.
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
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::SparseDenseCwiseAdd Class Reference\n\ntensorflow::ops::SparseDenseCwiseAdd\n====================================\n\n`#include \u003csparse_ops.h\u003e`\n\nAdds up a SparseTensor and a dense [Tensor](/versions/r2.2/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor), using these special rules:\n\nSummary\n-------\n\n(1) Broadcasts the dense side to have the same shape as the sparse side, if eligible; (2) Then, only the dense values pointed to by the indices of the SparseTensor participate in the cwise addition.\n\nBy these rules, the result is a logical SparseTensor with exactly the same indices and shape, but possibly with different non-zero values. The output of this Op is the resultant non-zero values.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- sp_indices: 2-D. `N x R` matrix with the indices of non-empty values in a SparseTensor, possibly not in canonical ordering.\n- sp_values: 1-D. `N` non-empty values corresponding to `sp_indices`.\n- sp_shape: 1-D. Shape of the input SparseTensor.\n- dense: `R`-D. The dense [Tensor](/versions/r2.2/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) operand.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): 1-D. The `N` values that are operated on.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SparseDenseCwiseAdd](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1a40c54ec3d21552370675a287e1998c0f)`(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)` sp_indices, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sp_values, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sp_shape, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` dense)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1a72eb8f04e1ba3079957c50afaaa13e79) | [Operation](/versions/r2.2/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1afe9875882370618c9e8b76e5d1dccb26) | `::`[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_dense_cwise_add_1a4e49f5451389b499b3f51dfeb39146b6)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1ac05df51f21a0dc708e8ab33c853e5d6c)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_dense_cwise_add_1af0582cc0d8c6d71b9de9e50358f27392)`() const ` | ` ` ` ` |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### SparseDenseCwiseAdd\n\n```gdscript\n SparseDenseCwiseAdd(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input sp_indices,\n ::tensorflow::Input sp_values,\n ::tensorflow::Input sp_shape,\n ::tensorflow::Input dense\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```"]]