# tf_agents.specs.array_spec.sample_spec_nest

<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#L87-L111) |

Samples the given nest of specs.

    tf_agents.specs.array_spec.sample_spec_nest(
        structure, rng, outer_dims=()
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `structure` | An `ArraySpec`, or a nested dict, list or tuple of `ArraySpec`s. |
| `rng` | A numpy RandomState to use for the sampling. |
| `outer_dims` | An optional list/tuple specifying outer dimensions to add to the spec shape before sampling. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A nest of sampled values following the ArraySpec definition. ||

<br />