# tf.TensorArraySpec

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.7.4/tensorflow/python/ops/tensor_array_ops.py#L1342-L1444) |

Type specification for a [`tf.TensorArray`](https://www.tensorflow.org/versions/r2.7/api_docs/python/tf/TensorArray).

Inherits From: [`TypeSpec`](https://www.tensorflow.org/versions/r2.7/api_docs/python/tf/TypeSpec)

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.TensorArraySpec`](https://www.tensorflow.org/api_docs/python/tf/TensorArraySpec)

<br />

    tf.TensorArraySpec(
        element_shape=None,
        dtype=https://www.tensorflow.org/versions/r2.7/api_docs/python/tf/dtypes#float32,
        dynamic_size=False,
        infer_shape=True
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `element_shape` | The shape of each element in the `TensorArray`. |
| `dtype` | Data type of the `TensorArray`. |
| `dynamic_size` | Whether the `TensorArray` can grow past its initial size. |
| `infer_shape` | Whether shape inference is enabled. |

<br />

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `value_type` | <br /> <br /> |

<br />

## Methods

### `from_value`

[View source](https://github.com/tensorflow/tensorflow/blob/v2.7.4/tensorflow/python/ops/tensor_array_ops.py#L1423-L1433)

    @staticmethod
    from_value(
        value
    )

### `is_compatible_with`

[View source](https://github.com/tensorflow/tensorflow/blob/v2.7.4/tensorflow/python/ops/tensor_array_ops.py#L1369-L1378)

    is_compatible_with(
        other
    )

Returns true if `spec_or_value` is compatible with this TypeSpec.

### `most_specific_compatible_type`

[View source](https://github.com/tensorflow/tensorflow/blob/v2.7.4/tensorflow/python/ops/tensor_array_ops.py#L1380-L1387)

    most_specific_compatible_type(
        other
    )

Returns the most specific TypeSpec compatible with `self` and `other`.

<br />

<br />

<br />

| Args ||
|---|---|
| `other` | A `TypeSpec`. |

<br />

<br />

<br />

<br />

| Raises ||
|---|---|
| `ValueError` | If there is no TypeSpec that is compatible with both `self` and `other`. |

<br />

### `__eq__`

[View source](https://github.com/tensorflow/tensorflow/blob/v2.7.4/tensorflow/python/framework/type_spec.py#L321-L324)

    __eq__(
        other
    ) -> bool

Return self==value.

### `__ne__`

[View source](https://github.com/tensorflow/tensorflow/blob/v2.7.4/tensorflow/python/framework/type_spec.py#L326-L327)

    __ne__(
        other
    ) -> bool

Return self!=value.