संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: स्पार्सकोनकैट
#include <sparse_ops.h>
निर्दिष्ट आयाम के साथ SparseTensor
की एक सूची को जोड़ता है।
सारांश
संयोजन इन विरल टेंसरों के सघन संस्करणों के संबंध में है। यह माना जाता है कि प्रत्येक इनपुट एक SparseTensor
है जिसके तत्वों को बढ़ती आयाम संख्या के साथ क्रमबद्ध किया जाता है।
कॉनकैट आयाम को छोड़कर, सभी इनपुट के आकार मेल खाने चाहिए। indices
, values
और shapes
सूची की लंबाई समान होनी चाहिए।
आउटपुट आकार इनपुट के समान है, कॉनकैट आयाम को छोड़कर, जहां यह उस आयाम के साथ इनपुट के आकार का योग है।
बढ़ते आयाम संख्या के साथ सॉर्ट क्रम को संरक्षित करने के लिए आउटपुट तत्वों का सहारा लिया जाएगा।
यह ऑप O(M log M)
समय में चलता है, जहां M
सभी इनपुट में गैर-रिक्त मानों की कुल संख्या है। यह एक मनमाने आयाम में कुशलतापूर्वक संयोजित करने के लिए एक आंतरिक सॉर्ट की आवश्यकता के कारण है।
उदाहरण के लिए, यदि concat_dim = 1
और इनपुट हैं
sp_inputs[0]: shape = [2, 3]
[0, 2]: "a"
[1, 0]: "b"
[1, 1]: "c"
sp_inputs[1]: shape = [2, 4]
[0, 1]: "d"
[0, 2]: "e"
तो आउटपुट होगा
shape = [2, 7]
[0, 2]: "a"
[0, 4]: "d"
[0, 5]: "e"
[1, 0]: "b"
[1, 1]: "c"
ग्राफिक रूप से यह करने के बराबर है
[ a] concat [ d e ] = [ a d e ]
[b c ] [ ] [b c ]
तर्क:
- स्कोप: एक स्कोप ऑब्जेक्ट
- सूचकांक: 2-डी. प्रत्येक इनपुट
SparseTensor
के सूचकांक। - मान: 1-डी. प्रत्येक
SparseTensor
के गैर-रिक्त मान। - आकार: 1-डी. प्रत्येक
SparseTensor
के आकार। - concat_dim: साथ में जोड़ने के लिए आयाम। रेंज [-रैंक, रैंक) में होना चाहिए, जहां रैंक प्रत्येक इनपुट
SparseTensor
में आयामों की संख्या है।
रिटर्न:
-
Output
आउटपुट_इंडिसेस: 2-डी। संयोजित SparseTensor
के सूचकांक। -
Output
आउटपुट_मान: 1-डी। संयोजित SparseTensor
के गैर-रिक्त मान। -
Output
आउटपुट_आकार: 1-डी। संयोजित SparseTensor
का आकार।
सार्वजनिक गुण
सार्वजनिक समारोह
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को 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::SparseConcat Class Reference\n\ntensorflow::ops::SparseConcat\n=============================\n\n`#include \u003csparse_ops.h\u003e`\n\nConcatenates a list of `SparseTensor` along the specified dimension.\n\nSummary\n-------\n\nConcatenation is with respect to the dense versions of these sparse tensors. It is assumed that each input is a `SparseTensor` whose elements are ordered along increasing dimension number.\n\n[All](/versions/r2.0/api_docs/cc/class/tensorflow/ops/all#classtensorflow_1_1ops_1_1_all) inputs' shapes must match, except for the concat dimension. The `indices`, `values`, and `shapes` lists must have the same length.\n\nThe output shape is identical to the inputs', except along the concat dimension, where it is the sum of the inputs' sizes along that dimension.\n\nThe output elements will be resorted to preserve the sort order along increasing dimension number.\n\nThis op runs in `O(M log M)` time, where `M` is the total number of non-empty values across all inputs. This is due to the need for an internal sort in order to concatenate efficiently across an arbitrary dimension.\n\nFor example, if `concat_dim = 1` and the inputs are \n\n```scdoc\nsp_inputs[0]: shape = [2, 3]\n[0, 2]: \"a\"\n[1, 0]: \"b\"\n[1, 1]: \"c\"\n\nsp_inputs[1]: shape = [2, 4]\n[0, 1]: \"d\"\n[0, 2]: \"e\"\n```\n\n\u003cbr /\u003e\n\nthen the output will be \n\n```text\nshape = [2, 7]\n[0, 2]: \"a\"\n[0, 4]: \"d\"\n[0, 5]: \"e\"\n[1, 0]: \"b\"\n[1, 1]: \"c\"\n```\n\n\u003cbr /\u003e\n\nGraphically this is equivalent to doing \n\n```ini\n[ a] concat [ d e ] = [ a d e ]\n[b c ] [ ] [b c ]\n```\n\n\u003cbr /\u003e\n\nArguments:\n\n- scope: A [Scope](/versions/r2.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- indices: 2-D. Indices of each input `SparseTensor`.\n- values: 1-D. Non-empty values of each `SparseTensor`.\n- shapes: 1-D. Shapes of each `SparseTensor`.\n- concat_dim: Dimension to concatenate along. Must be in range \\[-rank, rank), where rank is the number of dimensions in each input `SparseTensor`.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_indices: 2-D. Indices of the concatenated `SparseTensor`.\n- [Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_values: 1-D. Non-empty values of the concatenated `SparseTensor`.\n- [Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_shape: 1-D. Shape of the concatenated `SparseTensor`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SparseConcat](#classtensorflow_1_1ops_1_1_sparse_concat_1a50aa275ec5a88496fd4e99f0f1003616)`(const ::`[tensorflow::Scope](/versions/r2.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::InputList](/versions/r2.0/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` indices, ::`[tensorflow::InputList](/versions/r2.0/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` values, ::`[tensorflow::InputList](/versions/r2.0/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` shapes, int64 concat_dim)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_sparse_concat_1a8db5a398751bcf0e460c5032ae1ab292) | [Operation](/versions/r2.0/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output_indices](#classtensorflow_1_1ops_1_1_sparse_concat_1a79b9cef174b8488e90f52907d6d64a0f) | `::`[tensorflow::Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [output_shape](#classtensorflow_1_1ops_1_1_sparse_concat_1ae3130991367ac10382b9a6a310b1eff5) | `::`[tensorflow::Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [output_values](#classtensorflow_1_1ops_1_1_sparse_concat_1a626bd96bc86fb8ecddbd8cbb7a6828cf) | `::`[tensorflow::Output](/versions/r2.0/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### output_indices\n\n```scdoc\n::tensorflow::Output output_indices\n``` \n\n### output_shape\n\n```scdoc\n::tensorflow::Output output_shape\n``` \n\n### output_values\n\n```scdoc\n::tensorflow::Output output_values\n``` \n\nPublic functions\n----------------\n\n### SparseConcat\n\n```gdscript\n SparseConcat(\n const ::tensorflow::Scope & scope,\n ::tensorflow::InputList indices,\n ::tensorflow::InputList values,\n ::tensorflow::InputList shapes,\n int64 concat_dim\n)\n```"]]