# tensorflow::ops::TensorArray::Attrs

`#include <data_flow_ops.h>`

Optional attribute setters for [TensorArray](https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array).

## Summary

| ### Public attributes ||
|---|---|
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1adf69f46749934d660c3721550ea1c03a = true` | `bool` |
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a8ad7c8391ad0b235dfdfd5a6db9732e3 = false` | `bool` |
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a72e5eb3fb8c00fe4a457046e3ebbaabf = ::tensorflow::PartialTensorShape()` | `PartialTensorShape` |
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a54f4ec465ff422399336316e2593ecd1 = false` | `bool` |
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1abf20ffc7391f652ec55c110cc1ef6a62 = ""` | `StringPiece` |

| ### Public functions ||
|---|---|
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1afd43b315da52533acfc34c6cf9bb6d0c(bool x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs` If true (default), Tensors in the [TensorArray](https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) are cleared after being read. |
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a2e7a4d021eec60921c502ca0af09cfd1(bool x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs` A boolean that determines whether writes to the [TensorArray](https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) are allowed to grow the size. |
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1aa6759843dcee15a20ca580b47055468c(PartialTensorShape x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs` The expected shape of an element, if known. |
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a821ffb1df33eb2716154fe6c0ed03284(bool x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs` If true (default is false), then all elements in the [TensorArray](https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) will be expected to have have identical shapes. |
| `https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a8ba097c423bc48c48ee1d8ac417dd021(StringPiece x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r1.15/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs` Overrides the name used for the temporary tensor_array resource. |

## Public attributes

### clear_after_read_

```
bool tensorflow::ops::TensorArray::Attrs::clear_after_read_ = true
```

### dynamic_size_

```
bool tensorflow::ops::TensorArray::Attrs::dynamic_size_ = false
```

### element_shape_

```
PartialTensorShape tensorflow::ops::TensorArray::Attrs::element_shape_ = ::tensorflow::PartialTensorShape()
```

### identical_element_shapes_

```
bool tensorflow::ops::TensorArray::Attrs::identical_element_shapes_ = false
```

### tensor_array_name_

```
StringPiece tensorflow::ops::TensorArray::Attrs::tensor_array_name_ = ""
```

## Public functions

### ClearAfterRead

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::ClearAfterRead(
  bool x
)
```
If true (default), Tensors in the [TensorArray](https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) are cleared after being read.

This disables multiple read semantics but allows early release of memory.

Defaults to true

### DynamicSize

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::DynamicSize(
  bool x
)
```
A boolean that determines whether writes to the [TensorArray](https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) are allowed to grow the size.

By default, this is not allowed.

Defaults to false

### ElementShape

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::ElementShape(
  PartialTensorShape x
)
```
The expected shape of an element, if known.

Used to validate the shapes of [TensorArray](https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) elements. If this shape is not fully specified, gathering zero-size TensorArrays is an error.

Defaults to

### IdenticalElementShapes

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::IdenticalElementShapes(
  bool x
)
```
If true (default is false), then all elements in the [TensorArray](https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) will be expected to have have identical shapes.

This allows certain behaviors, like dynamically checking for consistent shapes on write, and being able to fill in properly shaped zero tensors on stack even if the element_shape attribute is not fully defined.

Defaults to false

### TensorArrayName

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::TensorArrayName(
  StringPiece x
)
```
Overrides the name used for the temporary tensor_array resource.

Default value is the name of the '[TensorArray](https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array)' op (which is guaranteed unique).

Defaults to ""