Link Search Menu Expand Document

TensorArray


tensorflow C++ API

tensorflow::ops::TensorArray

An array of Tensors of given size.


Summary

Write data via Write and read via Read or Pack.

Arguments:

  • scope: A Scope object
  • size: The size of the array.
  • dtype: The type of the elements on the tensor_array.

Optional attributes (seeAttrs):

  • element_shape: The expected shape of an element, if known. Used to validate the shapes of TensorArray elements. If this shape is not fully specified, gathering zero-size TensorArrays is an error.
  • dynamic_size: A boolean that determines whether writes to the TensorArray are allowed to grow the size. By default, this is not allowed.
  • clear_after_read: If true (default), Tensors in the TensorArray are cleared after being read. This disables multiple read semantics but allows early release of memory.
  • tensor_array_name: Overrides the name used for the temporary tensor_array resource. Default value is the name of the `TensorArray’ op (which is guaranteed unique).

Returns:

  • Output handle: The handle to the TensorArray.
  • Output flow: A scalar used to control gradient flow.

Constructor

  • TensorArray(const ::tensorflow::Scope & scope, ::tensorflow::Input size, DataType dtype, const TensorArray::Attrs & attrs).

Public attributes

  • tensorflow::Output flow.
  • tensorflow::Output handle.

TensorArray block

Source link : https://github.com/EXPNUNI/enuSpace-Tensorflow/blob/master/enuSpaceTensorflow/tf_data_flow_ops.cpp

Argument:

  • Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.)
  • size : connect Input node or input array size.
  • DataType dtype : input DataType. ex) DT_DOUBLE;
  • TensorArray::Attrs attrs : input attrs data. ex) element_shape_ = ; dynamic_size_ = false; clear_after_read_ = true; tensor_array_name_ =;

Return:

  • Output flow: Output object of TensorArray class object.
  • Output handle: Output handle of TensorArray class object.

Result:

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

Using Method