Module: tf_agents.specs.tensor_spec

View source on GitHub

Utilities related to TensorSpec class.

Functions

add_outer_dims_nest(...): Adds outer dimensions to the shape of input specs.

from_pbtxt_file(...): Loads a spec encoded as a struct_pb2.StructuredValue from a pbtxt file.

from_proto(...): Decodes a struct_pb2.StructuredValue proto into a nested spec.

from_spec(...): Maps the given spec into corresponding TensorSpecs keeping bounds.

is_bounded(...)

is_continuous(...)

is_discrete(...)

sample_bounded_spec(...): Samples uniformily the given bounded spec.

sample_spec_nest(...): Samples the given nest of specs.

to_array_spec(...): Converts TensorSpec into ArraySpec.

to_nest_array_spec(...): Converted a nest of TensorSpecs to a nest of matching ArraySpecs.

to_nest_placeholder(...): Converts a nest of TensorSpecs to a nest of matching placeholders.

to_pbtxt_file(...): Saves a spec encoded as a struct_pb2.StructuredValue in a pbtxt file.

to_placeholder(...): Creates a placeholder from TensorSpec.

to_placeholder_with_default(...): Creates a placeholder from TensorSpec.

to_proto(...): Encodes a nested spec into a struct_pb2.StructuredValue proto.

zero_spec_nest(...): Create zero tensors for a given spec.