संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: इकट्ठा करना #include <array_ops.h>
indices
के अनुसार params
से स्लाइस इकट्ठा करें ।
सारांश indices
किसी भी आयाम (आमतौर पर 0-डी या 1-डी) का पूर्णांक टेंसर होना चाहिए। आकृति indices.shape + params.shape[1:]
के साथ एक आउटपुट टेंसर तैयार करता है जहां:
# Scalar indices
output[:, ..., :] = params[indices, :, ... :]
# Vector indices
output [ i, :, ..., : ] = params [ indices[i ] , : , ... :]
# Higher rank indices
output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :] यदि indices
एक क्रमपरिवर्तन है और len(indices) == params.shape[0]
तो यह ऑपरेशन तदनुसार params
क्रमपरिवर्तित करेगा।
validate_indices
: अस्वीकृत। यदि यह ऑपरेशन सीपीयू को सौंपा गया है, तो indices
में मान हमेशा सीमा के भीतर होने के लिए मान्य होते हैं। यदि जीपीयू को सौंपा गया है, तो आउट-ऑफ-बाउंड सूचकांकों के परिणामस्वरूप सुरक्षित लेकिन अनिर्दिष्ट व्यवहार होता है, जिसमें त्रुटि उत्पन्न करना शामिल हो सकता है।
तर्क:
रिटर्न:
सार्वजनिक गुण सार्वजनिक समारोह नोड
:: tensorflow :: Node * node () const
operator :: tensorflow :: Input () const
ऑपरेटर::टेन्सरफ़्लो::आउटपुट
operator :: tensorflow :: Output () const
सार्वजनिक स्थैतिक कार्य मान्य सूचकांक
Attrs ValidateIndices(
bool x
)
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया."],[],[],null,["# tensorflow::ops::Gather Class Reference\n\ntensorflow::ops::Gather\n=======================\n\n`#include \u003carray_ops.h\u003e`\n\n[Gather](/versions/r2.1/api_docs/cc/class/tensorflow/ops/gather#classtensorflow_1_1ops_1_1_gather) slices from `params` according to `indices`.\n\nSummary\n-------\n\n`indices` must be an integer tensor of any dimension (usually 0-D or 1-D). Produces an output tensor with shape `indices.shape + params.shape[1:]` where:\n\n\n```text\n # Scalar indices\n output[:, ..., :] = params[indices, :, ... :]\n```\n\n\u003cbr /\u003e\n\n\n```transact-sql\n # Vector indices\n output[i, :, ..., :] = params[indices[i], :, ... :]\n```\n\n\u003cbr /\u003e\n\n\n```text\n # Higher rank indices\n output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :]\n```\n\n\u003cbr /\u003e\n\nIf `indices` is a permutation and `len(indices) == params.shape[0]` then this operation will permute `params` accordingly.\n\n`validate_indices`: DEPRECATED. If this operation is assigned to CPU, values in `indices` are always validated to be within range. If assigned to GPU, out-of-bound indices result in safe but unspecified behavior, which may include raising an error.\n\n\n\u003cbr /\u003e\n\nArguments:\n\n- scope: A [Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The output tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [Gather](#classtensorflow_1_1ops_1_1_gather_1a839275b14b2a970a2bdaafee039469dd)`(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)` params, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` indices)` ||\n| [Gather](#classtensorflow_1_1ops_1_1_gather_1aafacd8f95dd561da28cb61d32a6a315f)`(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)` params, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` indices, const `[Gather::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/gather/attrs#structtensorflow_1_1ops_1_1_gather_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_gather_1a324a25a3a94bb8ec9ea1f0c18e864f7d) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_gather_1a9d78b5b304387efee0e53b5afaa384ef) | `::`[tensorflow::Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_gather_1a6861dab37fe274f230029422bd94b724)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_gather_1a8ea808391c4824b35409a4427fcfd5eb)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_gather_1a3dfd72e34f22afeaad6918d75a6cfdcd)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|\n| [ValidateIndices](#classtensorflow_1_1ops_1_1_gather_1acb10767dcd5da7c1d454b97feafe2f3b)`(bool x)` | [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/gather/attrs#structtensorflow_1_1ops_1_1_gather_1_1_attrs) |\n\n| ### Structs ||\n|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::Gather::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/gather/attrs) | Optional attribute setters for [Gather](/versions/r2.1/api_docs/cc/class/tensorflow/ops/gather#classtensorflow_1_1ops_1_1_gather). |\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### Gather\n\n```gdscript\n Gather(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input params,\n ::tensorflow::Input indices\n)\n``` \n\n### Gather\n\n```gdscript\n Gather(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input params,\n ::tensorflow::Input indices,\n const Gather::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### ValidateIndices\n\n```text\nAttrs ValidateIndices(\n bool x\n)\n```"]]