TakeManySparseFromTensorsMap


tensorflow C++ API

tensorflow::ops::TakeManySparseFromTensorsMap

ReadSparseTensorsfrom aSparseTensorsMapand concatenate them.


Summary

The inputsparse_handlesmust be anint64matrix of shape[N, 1]whereNis the minibatch size and the rows correspond to the output handles ofAddSparseToTensorsMaporAddManySparseToTensorsMap. The ranks of the originalSparseTensorobjects that went into the given input ops must all match. When the finalSparseTensoris created, it has rank one higher than the ranks of the incomingSparseTensorobjects (they have been concatenated along a new row dimension on the left).

The outputSparseTensorobject's shape values for all dimensions but the first are the max across the inputSparseTensorobjects' shape values for the corresponding dimensions. Its first shape value isN, the minibatch size.

The inputSparseTensorobjects' indices are assumed ordered in standard lexicographic order. If this is not the case, after this step runSparseReorderto restore index ordering.

For example, if the handles represent an input, which is a[2, 3]matrix representing two originalSparseTensorobjects:

``` index = [ 0] [10] [20] values = [1, 2, 3] shape = [50] ```

and

``` index = [ 2] [10] values = [4, 5] shape = [30] ```

then the finalSparseTensorwill be:

``` index = [0 0] [0 10] [0 20] [1 2] [1 10] values = [1, 2, 3, 4, 5] shape = [2 50] ```

Arguments:

  • scope: A Scopeobject
  • sparse_handles: 1-D, TheNserializedSparseTensorobjects.Shape:[N].
  • dtype: Thedtypeof theSparseTensorobjects stored in theSparseTensorsMap.

Optional attributes (seeAttrs):

  • container: The container name for theSparseTensorsMapread by this op.
  • shared_name: The shared name for theSparseTensorsMapread by this op. It should not be blank; rather theshared_name or uniqueOperation name of the Op that created the originalSparseTensorsMapshould be used.

Returns:

  • Outputsparse_indices: 2-D. Theindicesof the minibatchSparseTensor.
  • Outputsparse_values: 1-D. Thevaluesof the minibatchSparseTensor.
  • Outputsparse_shape: 1-D. Theshapeof the minibatchSparseTensor.

TakeManySparseFromTensorsMap block

Source link : https://github.com/EXPNUNI/enuSpaceTensorflow/blob/master/enuSpaceTensorflow/tf_sparse.cpp

Argument:

  • Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.)
  • Input sparse_handles: connect Input node.
  • Input output_shape: connect Input node.
  • Datatype dtype : Input DataType in value ex)DT_FLOAT;
  • TakeManySparseFromTensorsMap ::Attrs attrs : Input attrs in value. ex) container_ =;shared_name_ =AB;

Return:

  • Output sparse_indices: Output object of TakeManySparseFromTensorsMap class object.
  • Output sparse_values: Output object of TakeManySparseFromTensorsMap class object.
  • Output sparse_shape: Output object of TakeManySparseFromTensorsMap class object.

Result:

  • std::vector(Tensor) result_sparse_indices : Returned object of executed result by calling session.
  • std::vector(Tensor) result_sparse_values : Returned object of executed result by calling session.
  • std::vector(Tensor) result_output_shape : Returned object of executed result by calling session.

Using Method

results matching ""

    No results matching ""