संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: विरलजोड़ें
#include <sparse_ops.h>
एक और SparseTensor
बनाने के लिए दो SparseTensor
ऑब्जेक्ट जोड़ता है।
सारांश
इनपुट SparseTensor
ऑब्जेक्ट के सूचकांकों को मानक लेक्सिकोग्राफ़िक क्रम में क्रमबद्ध माना जाता है। यदि ऐसा नहीं है, तो इस चरण से पहले इंडेक्स ऑर्डर को पुनर्स्थापित करने के लिए SparseReorder
चलाएँ।
डिफ़ॉल्ट रूप से, यदि किसी इंडेक्स पर दो मानों का योग शून्य है, तो आउटपुट SparseTensor
अभी भी उस विशेष स्थान को अपने इंडेक्स में शामिल करेगा, संबंधित मान स्लॉट में शून्य संग्रहीत करेगा। इसे ओवरराइड करने के लिए, कॉल करने वाले thresh
निर्दिष्ट कर सकते हैं, जो दर्शाता है कि यदि योग का परिमाण thresh
से बिल्कुल छोटा है, तो इसके संबंधित मूल्य और सूचकांक को शामिल नहीं किया जाएगा। विशेष रूप से, thresh == 0
(डिफ़ॉल्ट) का अर्थ है कि सब कुछ रखा गया है और वास्तविक थ्रेशोल्डिंग केवल सकारात्मक मान के लिए होती है।
निम्नलिखित आकृतियों में, nnz
thresh
ध्यान में रखने के बाद की गिनती है।
तर्क:
- स्कोप: एक स्कोप ऑब्जेक्ट
- a_indices: 2-D. पहले
SparseTensor
के indices
, आकार [nnz, ndims]
मैट्रिक्स। - a_मान: 1-डी. पहले
SparseTensor
का values
, आकार [nnz]
वेक्टर। - a_आकार: 1-डी. पहले
SparseTensor
का shape
, आकार [ndims]
वेक्टर। - b_indices: 2-D. दूसरे
SparseTensor
के indices
, आकार [nnz, ndims]
मैट्रिक्स। - b_मान: 1-डी. दूसरे
SparseTensor
का values
, आकार [nnz]
वेक्टर। - b_आकार: 1-डी. दूसरे
SparseTensor
का shape
, आकार [ndims]
वेक्टर। - थ्रेश: 0-डी. परिमाण सीमा जो यह निर्धारित करती है कि कोई आउटपुट मान/सूचकांक युग्म स्थान लेता है या नहीं।
रिटर्न:
सार्वजनिक गुण
सार्वजनिक समारोह
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[],[],null,["# tensorflow::ops::SparseAdd Class Reference\n\ntensorflow::ops::SparseAdd\n==========================\n\n`#include \u003csparse_ops.h\u003e`\n\nAdds two `SparseTensor` objects to produce another `SparseTensor`.\n\nSummary\n-------\n\nThe input `SparseTensor` objects' indices are assumed ordered in standard lexicographic order. If this is not the case, before this step run [SparseReorder](/versions/r2.3/api_docs/cc/class/tensorflow/ops/sparse-reorder#classtensorflow_1_1ops_1_1_sparse_reorder) to restore index ordering.\n\nBy default, if two values sum to zero at some index, the output `SparseTensor` would still include that particular location in its index, storing a zero in the corresponding value slot. To override this, callers can specify `thresh`, indicating that if the sum has a magnitude strictly smaller than `thresh`, its corresponding value and index would then not be included. In particular, `thresh == 0` (default) means everything is kept and actual thresholding happens only for a positive value.\n\nIn the following shapes, `nnz` is the count after taking `thresh` into account.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- a_indices: 2-D. The `indices` of the first `SparseTensor`, size `[nnz, ndims]` Matrix.\n- a_values: 1-D. The `values` of the first `SparseTensor`, size `[nnz]` Vector.\n- a_shape: 1-D. The `shape` of the first `SparseTensor`, size `[ndims]` Vector.\n- b_indices: 2-D. The `indices` of the second `SparseTensor`, size `[nnz, ndims]` Matrix.\n- b_values: 1-D. The `values` of the second `SparseTensor`, size `[nnz]` Vector.\n- b_shape: 1-D. The `shape` of the second `SparseTensor`, size `[ndims]` Vector.\n- thresh: 0-D. The magnitude threshold that determines if an output value/index pair takes space.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) sum_indices\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) sum_values\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) sum_shape\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SparseAdd](#classtensorflow_1_1ops_1_1_sparse_add_1a07c65af8c10333ec7605e9a7f0a1be2b)`(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_indices, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` a_values, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` a_shape, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` b_indices, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` b_values, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` b_shape, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` thresh)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_sparse_add_1aab871539035af62dcf3df695fc396ba0) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [sum_indices](#classtensorflow_1_1ops_1_1_sparse_add_1a935595157260ea9fcff05da3c0341947) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [sum_shape](#classtensorflow_1_1ops_1_1_sparse_add_1a573a3dbb573b8d6fb0172ca669d4685f) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [sum_values](#classtensorflow_1_1ops_1_1_sparse_add_1a2cc06856b4695dd0ba3ea4f686160ddf) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### sum_indices\n\n```scdoc\n::tensorflow::Output sum_indices\n``` \n\n### sum_shape\n\n```scdoc\n::tensorflow::Output sum_shape\n``` \n\n### sum_values\n\n```scdoc\n::tensorflow::Output sum_values\n``` \n\nPublic functions\n----------------\n\n### SparseAdd\n\n```gdscript\n SparseAdd(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input a_indices,\n ::tensorflow::Input a_values,\n ::tensorflow::Input a_shape,\n ::tensorflow::Input b_indices,\n ::tensorflow::Input b_values,\n ::tensorflow::Input b_shape,\n ::tensorflow::Input thresh\n)\n```"]]