संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: SparseReshape
#include <sparse_ops.h>
एक नए घने आकार में मूल्यों का प्रतिनिधित्व करने के लिए SparseTensor को नया आकार देता है।
सारांश
इस ऑपरेशन में दर्शाए गए घने टेंसर पर पुनः आकार देने के समान ही शब्दार्थ हैं। अनुरोधित new_shape
के आधार पर input_indices
पुनः गणना की जाती है।
यदि new_shape
का एक घटक विशेष मान -1 है, तो उस आयाम के आकार की गणना की जाती है ताकि कुल सघन आकार स्थिर रहे। new_shape
का अधिकतम एक घटक -1 हो सकता है। new_shape
द्वारा निहित सघन तत्वों की संख्या मूल रूप से input_shape
द्वारा निहित सघन तत्वों की संख्या के समान होनी चाहिए।
पुनः आकार देने से SparseTensor में मानों का क्रम प्रभावित नहीं होता है।
यदि इनपुट टेंसर में रैंक R_in
और N
गैर-रिक्त मान हैं, और new_shape
की लंबाई R_out
है, तो input_indices
का आकार [N, R_in]
है, input_shape
की लंबाई R_in
है, output_indices
का आकार [N, R_out]
है, और output_shape
की लंबाई R_out
है।
तर्क:
- स्कोप: एक स्कोप ऑब्जेक्ट
- इनपुट_सूचकांक: 2-डी। SparseTensor में गैर-रिक्त मानों के सूचकांक के साथ
N x R_in
मैट्रिक्स। - इनपुट_आकार: 1-डी. इनपुट SparseTensor के सघन आकार के साथ वेक्टर
R_in
। - नया_आकार: 1-डी. अनुरोधित नए घने आकार के साथ
R_out
वेक्टर।
रिटर्न:
-
Output
आउटपुट_इंडिसेस: 2-डी। आउटपुट SparseTensor में गैर-रिक्त मानों के अद्यतन सूचकांक के साथ N x R_out
मैट्रिक्स। -
Output
आउटपुट_आकार: 1-डी। आउटपुट SparseTensor के पूर्ण सघन आकार के साथ R_out
वेक्टर। यह new_shape
के समान है लेकिन कोई भी -1 आयाम भरा हुआ है।
सार्वजनिक गुण
सार्वजनिक समारोह
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को 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::SparseReshape Class Reference\n\ntensorflow::ops::SparseReshape\n==============================\n\n`#include \u003csparse_ops.h\u003e`\n\nReshapes a SparseTensor to represent values in a new dense shape.\n\nSummary\n-------\n\nThis operation has the same semantics as reshape on the represented dense tensor. The `input_indices` are recomputed based on the requested `new_shape`.\n\nIf one component of `new_shape` is the special value -1, the size of that dimension is computed so that the total dense size remains constant. At most one component of `new_shape` can be -1. The number of dense elements implied by `new_shape` must be the same as the number of dense elements originally implied by `input_shape`.\n\nReshaping does not affect the order of values in the SparseTensor.\n\nIf the input tensor has rank `R_in` and `N` non-empty values, and `new_shape` has length `R_out`, then `input_indices` has shape `[N, R_in]`, `input_shape` has length `R_in`, `output_indices` has shape `[N, R_out]`, and `output_shape` has length `R_out`.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input_indices: 2-D. `N x R_in` matrix with the indices of non-empty values in a SparseTensor.\n- input_shape: 1-D. `R_in` vector with the input SparseTensor's dense shape.\n- new_shape: 1-D. `R_out` vector with the requested new dense shape.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_indices: 2-D. `N x R_out` matrix with the updated indices of non-empty values in the output SparseTensor.\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_shape: 1-D. `R_out` vector with the full dense shape of the output SparseTensor. This is the same as `new_shape` but with any -1 dimensions filled in.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SparseReshape](#classtensorflow_1_1ops_1_1_sparse_reshape_1a57501c2498594b147ac9bb4b371ab2ef)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input_indices, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input_shape, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` new_shape)` ||\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_sparse_reshape_1a19240d0378428b2bf0b30ef7badcea50) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output_indices](#classtensorflow_1_1ops_1_1_sparse_reshape_1a3c4d3f0b4883e4bacc4c3ba450e72431) | `::`[tensorflow::Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [output_shape](#classtensorflow_1_1ops_1_1_sparse_reshape_1a93b02c760fe2a4ea9a8495f1f8151c51) | `::`[tensorflow::Output](/versions/r2.1/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\nPublic functions\n----------------\n\n### SparseReshape\n\n```gdscript\n SparseReshape(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input_indices,\n ::tensorflow::Input input_shape,\n ::tensorflow::Input new_shape\n)\n```"]]