# Module: tf_agents.specs

<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/__init__.py) |

Module for numpy array and [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) shape and dtype specifications.

## Modules

[`array_spec`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/specs/array_spec) module: A class to describe the shape and dtype of numpy arrays.

[`bandit_spec_utils`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/specs/bandit_spec_utils) module: Bandit related tensor spec utilities.

[`distribution_spec`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/specs/distribution_spec) module: Spec definition for tensorflow_probability.Distribution.

[`tensor_spec`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/specs/tensor_spec) module: Utilities related to TensorSpec class.

## Classes

[`class ArraySpec`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/specs/ArraySpec): Describes a numpy array or scalar shape and dtype.

[`class BoundedArraySpec`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/specs/BoundedArraySpec): An `ArraySpec` that specifies minimum and maximum values.

## Functions

[`from_spec(...)`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/specs/from_spec): Maps the given spec into corresponding TensorSpecs keeping bounds.

[`is_bounded(...)`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/specs/is_bounded)

[`is_continuous(...)`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/specs/is_continuous)

[`is_discrete(...)`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/specs/is_discrete)

[`sample_spec_nest(...)`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/specs/sample_spec_nest): Samples the given nest of specs.

[`zero_spec_nest(...)`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/specs/zero_spec_nest): Create zero tensors for a given spec.