Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::AddManySparseToTensorsMap
#include <sparse_ops.h>
Add an N
-minibatch SparseTensor
to a SparseTensorsMap
, return N
handles.
Summary
A SparseTensor
of rank R
is represented by three tensors: sparse_indices
, sparse_values
, and sparse_shape
, where
```sparse_indices.shape[1] == sparse_shape.shape[0] == R
An N
-minibatch of SparseTensor
objects is represented as a SparseTensor
having a first sparse_indices
column taking values between [0, N)
, where
the minibatch size N == sparse_shape[0]
.
The input SparseTensor
must have rank R
greater than 1, and the first
dimension is treated as the minibatch dimension. Elements of the SparseTensor
must be sorted in increasing order of this first dimension. The stored
SparseTensor
objects pointed to by each row of the output sparse_handles
will have rank R-1
.
The SparseTensor
values can then be read out as part of a minibatch by passing
the given keys as vector elements to TakeManySparseFromTensorsMap
. 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 created by calling
AddManySparseToTensorsMap
as the shared_name
passed to
TakeManySparseFromTensorsMap
. Ensure the Operations are colocated.
Args:
* scope: A Scope object
* sparse_indices: 2-D. The indices
of the minibatch SparseTensor
.
sparse_indices[:, 0]
must be ordered values in [0, N)
.
* sparse_values: 1-D. The values
of the minibatch SparseTensor
.
* sparse_shape: 1-D. The shape
of the minibatch SparseTensor
.
The minibatch size N == sparse_shape[0]
.
Optional attributes (see Attrs
):
* container: The container name for the SparseTensorsMap
created by this op.
* shared_name: The shared name for the SparseTensorsMap
created by this op.
If blank, the new Operation's unique name is used.
Returns:
* Output
: 1-D. The handles of the SparseTensor
now stored in the
SparseTensorsMap
. Shape: [N]
.
Public attributes
Public functions
node
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Public static functions
Container
Attrs Container(
StringPiece x
)
SharedName
Attrs SharedName(
StringPiece x
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tensorflow::ops::AddManySparseToTensorsMap Class Reference\n\ntensorflow::ops::AddManySparseToTensorsMap\n==========================================\n\n`#include \u003csparse_ops.h\u003e`\n\n[Add](/versions/r2.14/api_docs/cc/class/tensorflow/ops/add#classtensorflow_1_1ops_1_1_add) an `N`-minibatch `SparseTensor` to a `SparseTensorsMap`, return `N` handles.\n\nSummary\n-------\n\nA `SparseTensor` of rank `R` is represented by three tensors: `sparse_indices`, `sparse_values`, and `sparse_shape`, where\n\n\\`\\`\\`sparse_indices.shape\\[1\\] == sparse_shape.shape\\[0\\] == R \n\n```text\n\n```\n\n\u003cbr /\u003e\n\n\n An N-minibatch of SparseTensor objects is represented as a SparseTensor\n having a first sparse_indices column taking values between [0, N), where\n the minibatch size N == sparse_shape[0].\n\n\u003cbr /\u003e\n\n\n The input SparseTensor must have rank R greater than 1, and the first\n dimension is treated as the minibatch dimension. Elements of the SparseTensor\n must be sorted in increasing order of this first dimension. The stored\n SparseTensor objects pointed to by each row of the output sparse_handles\n will have rank R-1.\n\n\u003cbr /\u003e\n\n\n The SparseTensor values can then be read out as part of a minibatch by passing\n the given keys as vector elements to /versions/r2.14/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\n the correct SparseTensorsMap is accessed, ensure that the same\n container and shared_name are passed to that Op. If no shared_name\n is provided here, instead use the name of the Operation created by calling\n /versions/r2.14/api_docs/cc/class/tensorflow/ops/add-many-sparse-to-tensors-map#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map as the shared_name passed to\n /versions/r2.14/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\n\u003cbr /\u003e\n\n\n Args:\n * scope: A /versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope object\n * sparse_indices: 2-D. The indices of the minibatch SparseTensor.\n sparse_indices[:, 0] must be ordered values in [0, N).\n * sparse_values: 1-D. The `values` of the minibatch `SparseTensor`.\n * sparse_shape: 1-D. The shape of the minibatch SparseTensor.\n The minibatch size N == sparse_shape[0].\n\n\u003cbr /\u003e\n\n\n Optional attributes (see /versions/r2.14/api_docs/cc/struct/tensorflow/ops/add-many-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1_1_attrs):\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.\n If blank, the new Operation's unique name is used.\n\n\u003cbr /\u003e\n\n\n Returns:\n * /versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output: 1-D. The handles of the SparseTensor now stored in the\n SparseTensorsMap. Shape: [N]. \n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [AddManySparseToTensorsMap](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1a74a1831bfd1f27720873c62a4d963e68)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sparse_indices, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sparse_values, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sparse_shape)` ||\n| [AddManySparseToTensorsMap](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1a77594a24c914fe60afa8f2fffb2be090)`(const ::`[tensorflow::Scope](/versions/r2.14/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sparse_indices, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sparse_values, ::`[tensorflow::Input](/versions/r2.14/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sparse_shape, const `[AddManySparseToTensorsMap::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/add-many-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1a0f5ef46531573dcf0f5db668d43daa9b) | [Operation](/versions/r2.14/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [sparse_handles](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1ae6a15aa12ca7a7bdeffef3f72e82cbc2) | `::`[tensorflow::Output](/versions/r2.14/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1aa2be23efa50022636a98ca3a1901d6f9)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1a2019483d10b34a38eb43056dd01d0a67)`() const ` | |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1ab252ad5ffa96d26b5cd0d7a06ca1c45b)`() const ` | |\n\n| ### Public static functions ||\n|------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Container](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1ab040c34d4a6550b6f7856758403fe341)`(StringPiece x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/add-many-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1_1_attrs) |\n| [SharedName](#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1a437ebb905e580d3d568136057b214620)`(StringPiece x)` | [Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/add-many-sparse-to-tensors-map/attrs#structtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1_1_attrs) |\n\n| ### Structs ||\n|---------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::AddManySparseToTensorsMap::Attrs](/versions/r2.14/api_docs/cc/struct/tensorflow/ops/add-many-sparse-to-tensors-map/attrs) | Optional attribute setters for [AddManySparseToTensorsMap](/versions/r2.14/api_docs/cc/class/tensorflow/ops/add-many-sparse-to-tensors-map#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### sparse_handles\n\n```scdoc\n::tensorflow::Output sparse_handles\n``` \n\nPublic functions\n----------------\n\n### AddManySparseToTensorsMap\n\n```gdscript\n AddManySparseToTensorsMap(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input sparse_indices,\n ::tensorflow::Input sparse_values,\n ::tensorflow::Input sparse_shape\n)\n``` \n\n### AddManySparseToTensorsMap\n\n```gdscript\n AddManySparseToTensorsMap(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input sparse_indices,\n ::tensorflow::Input sparse_values,\n ::tensorflow::Input sparse_shape,\n const AddManySparseToTensorsMap::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```"]]