# tf_agents.specs.tensor_spec.to_array_spec

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/specs/tensor_spec.py#L86-L108) |

Converts TensorSpec into ArraySpec.

    tf_agents.specs.tensor_spec.to_array_spec(
        tensor_spec: Union[https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types#ArraySpec, https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types#DistributionSpecV2]
    ) -> https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/NestedArraySpec