تدفق التوتر:: العمليات:: AddSparseToTensorsMap
#include <sparse_ops.h>
قم بإضافة SparseTensor
إلى SparseTensorsMap
وإرجاع المقبض الخاص به.
ملخص
يتم تمثيل SparseTensor
بثلاثة موترات: sparse_indices
و sparse_values
و sparse_shape
.
يأخذ هذا العامل SparseTensor
المحدد ويضيفه إلى كائن الحاوية ( SparseTensorsMap
). يتم إنشاء مفتاح فريد داخل هذه الحاوية على شكل int64
، وهذه هي القيمة التي يتم إرجاعها.
يمكن بعد ذلك قراءة SparseTensor
كجزء من دفعة صغيرة عن طريق تمرير المفتاح كعنصر متجه إلى TakeManySparseFromTensorsMap
. لضمان الوصول إلى SparseTensorsMap
الصحيح، تأكد من تمرير نفس container
والاسم shared_name
إلى تلك العملية. إذا لم يتم توفير shared_name
هنا، فبدلاً من ذلك استخدم اسم العملية التي تم إنشاؤها عن طريق استدعاء AddSparseToTensorsMap
حيث تم تمرير الاسم shared_name
إلى TakeManySparseFromTensorsMap
. تأكد من أن العمليات متواجدة في مكان واحد.
الحجج:
- النطاق: كائن النطاق
- المؤشرات المتفرقة: 2-D.
indices
SparseTensor
. - القيم المتفرقة: 1-د.
values
SparseTensor
. - متفرق_الشكل: 1-د.
shape
SparseTensor
.
السمات الاختيارية (انظر Attrs
):
- الحاوية: اسم الحاوية لـ
SparseTensorsMap
الذي تم إنشاؤه بواسطة هذه العملية. - Shared_name: الاسم المشترك لـ
SparseTensorsMap
الذي تم إنشاؤه بواسطة هذه العملية. إذا كان فارغًا، فسيتم استخدام الاسم الفريد للعملية الجديدة.
العوائد:
-
Output
: 0-د. تم الآن تخزين مقبض SparseTensor
في SparseTensorsMap
.
الصفات العامة
عملية
Operation operation
-sparse_handle
::tensorflow::Output sparse_handle
الوظائف العامة
AddSparseToTensorsMap
AddSparseToTensorsMap(
const ::tensorflow::Scope & scope,
::tensorflow::Input sparse_indices,
::tensorflow::Input sparse_values,
::tensorflow::Input sparse_shape
)
AddSparseToTensorsMap
AddSparseToTensorsMap(
const ::tensorflow::Scope & scope,
::tensorflow::Input sparse_indices,
::tensorflow::Input sparse_values,
::tensorflow::Input sparse_shape,
const AddSparseToTensorsMap::Attrs & attrs
)
العقدة
::tensorflow::Node * node() const
operator::tensorflow::Input() const
المشغل::tensorflow::الإخراج
operator::tensorflow::Output() const
وظائف ثابتة العامة
حاوية
Attrs Container(
StringPiece x
)
الاسم المشترك
Attrs SharedName(
StringPiece x
)
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# tensorflow::ops::AddSparseToTensorsMap Class Reference\n\ntensorflow::ops::AddSparseToTensorsMap\n======================================\n\n`#include \u003csparse_ops.h\u003e`\n\n[Add](/versions/r1.15/api_docs/cc/class/tensorflow/ops/add#classtensorflow_1_1ops_1_1_add) a `SparseTensor` to a `SparseTensorsMap` return its handle.\n\nSummary\n-------\n\nA `SparseTensor` is represented by three tensors: `sparse_indices`, `sparse_values`, and `sparse_shape`.\n\nThis operator takes the given `SparseTensor` and adds it to a container object (a `SparseTensorsMap`). A unique key within this container is generated in the form of an `int64`, and this is the value that is returned.\n\nThe `SparseTensor` can then be read out as part of a minibatch by passing the key as a vector element to [TakeManySparseFromTensorsMap](/versions/r1.15/api_docs/cc/class/tensorflow/ops/take-many-sparse-from-tensors-map#classtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map). To ensure the correct `SparseTensorsMap` is accessed, ensure that the same `container` and `shared_name` are passed to that Op. If no `shared_name` is provided here, instead use the *name* of the [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) created by calling [AddSparseToTensorsMap](/versions/r1.15/api_docs/cc/class/tensorflow/ops/add-sparse-to-tensors-map#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map) as the `shared_name` passed to [TakeManySparseFromTensorsMap](/versions/r1.15/api_docs/cc/class/tensorflow/ops/take-many-sparse-from-tensors-map#classtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map). Ensure the Operations are colocated.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- sparse_indices: 2-D. The `indices` of the `SparseTensor`.\n- sparse_values: 1-D. The `values` of the `SparseTensor`.\n- sparse_shape: 1-D. The `shape` of the `SparseTensor`.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/add-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1_1_attrs)):\n\n- container: The container name for the `SparseTensorsMap` created by this op.\n- shared_name: The shared name for the `SparseTensorsMap` created by this op. If blank, the new [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation)'s unique name is used.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): 0-D. The handle of the `SparseTensor` now stored in the `SparseTensorsMap`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [AddSparseToTensorsMap](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1a19db933f8fd5d01db12d8b59d63bf06a)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sparse_indices, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sparse_values, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sparse_shape)` ||\n| [AddSparseToTensorsMap](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1aff3889e43d0d729ad526a005889b5626)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sparse_indices, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sparse_values, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sparse_shape, const `[AddSparseToTensorsMap::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/add-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1a3c43523211fb26d79e4d22b5149c4029) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [sparse_handle](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1a48d455f05445afe51dff6364bb8968c8) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1a416c237556b0e60bf15c9df4fcb04da1)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1a02d4fe7f3659971c2cb8e26287ed407e)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1a738ce7832c4e4854e1988426e9f3d0f7)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Container](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1a8d3e3d5c6cf3b841ecbbc82322d94a89)`(StringPiece x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/add-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1_1_attrs) |\n| [SharedName](#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1accd0cca1251e1cf70fe8c4d9498dd117)`(StringPiece x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/add-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1_1_attrs) |\n\n| ### Structs ||\n|------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::AddSparseToTensorsMap::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/add-sparse-to-tensors-map/attrs) | Optional attribute setters for [AddSparseToTensorsMap](/versions/r1.15/api_docs/cc/class/tensorflow/ops/add-sparse-to-tensors-map#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### sparse_handle\n\n```scdoc\n::tensorflow::Output sparse_handle\n``` \n\nPublic functions\n----------------\n\n### AddSparseToTensorsMap\n\n```gdscript\n AddSparseToTensorsMap(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input sparse_indices,\n ::tensorflow::Input sparse_values,\n ::tensorflow::Input sparse_shape\n)\n``` \n\n### AddSparseToTensorsMap\n\n```gdscript\n AddSparseToTensorsMap(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input sparse_indices,\n ::tensorflow::Input sparse_values,\n ::tensorflow::Input sparse_shape,\n const AddSparseToTensorsMap::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### Container\n\n```text\nAttrs Container(\n StringPiece x\n)\n``` \n\n### SharedName\n\n```text\nAttrs SharedName(\n StringPiece x\n)\n```"]]