Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tf_agents.specs.array_spec.sample_spec_nest

View source on GitHub

Samples the given nest of specs.

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

Args:

  • structure: An ArraySpec, or a nested dict, list or tuple of ArraySpecs.
  • 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.

Returns:

A nest of sampled values following the ArraySpec definition.