# tf_agents.specs.array_spec.sample_bounded_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/array_spec.py#L28-L84) |

Samples the given bounded spec.

    tf_agents.specs.array_spec.sample_bounded_spec(
        spec, rng
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `spec` | A BoundedSpec to sample. |
| `rng` | A numpy RandomState to use for the sampling. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| An np.array sample of the requested spec. ||

<br />