# tf_agents.specs.from_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#L66-L83) |

Maps the given spec into corresponding TensorSpecs keeping bounds.

#### View aliases


**Main aliases**

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

<br />

    tf_agents.specs.from_spec(
        spec
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Train a Deep Q Network with TF-Agents](https://www.tensorflow.org/agents/tutorials/1_dqn_tutorial) - [REINFORCE agent](https://www.tensorflow.org/agents/tutorials/6_reinforce_tutorial) |