tf.TensorArray.__init__(dtype, size=None, dynamic_size=None, clear_after_read=None, tensor_array_name=None, handle=None, flow=None, infer_shape=True, name=None)
Construct a new TensorArray or wrap an existing TensorArray handle.
A note about the parameter name:
The name of the TensorArray (even if passed in) is uniquified: each time a new TensorArray is created at runtime it is assigned its own name for the duration of the run. This avoids name collisions if a TensorArray is created within a while_loop.
Args:
-
dtype: (required) data type of the TensorArray. -
size: (optional) int32 scalarTensor: the size of the TensorArray. Required if handle is not provided. -
dynamic_size: (optional) Python bool: If true, writes to the TensorArray can grow the TensorArray past its initial size. Default: False. -
clear_after_read: Boolean (optional, default: True). If True, clear TensorArray values after reading them. This disables read-many semantics, but allows early release of memory. -
tensor_array_name: (optional) Python string: the name of the TensorArray. This is used when creating the TensorArray handle. If this value is set, handle should be None. -
handle: (optional) ATensorhandle to an existing TensorArray. If this is set, tensor_array_name should be None. -
flow: (optional) A floatTensorscalar coming from an existingTensorArray.flow. -
infer_shape: (optional, default: True) If True, shape inference is enabled. In this case, all elements must have the same shape. -
name: A name for the operation (optional).
Raises:
-
ValueError: if both handle and tensor_array_name are provided. -
TypeError: if handle is provided but is not a Tensor.
Please login to continue.