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

tf_agents.utils.example_encoding.get_example_decoder

View source on GitHub

Get an example decoder function for a nested spec.

tf_agents.utils.example_encoding.get_example_decoder(
    example_spec, batched=False
)

Given a spec, returns an example decoder function. The decoder function parses string serialized example protos into tensors according to the given spec.

Args:

  • example_spec: list/tuple/nest of ArraySpecs describing a single example.
  • batched: Boolean indicating if the decoder will receive batches of serialized data.

Returns:

Function

decoder(serialized_proto: tf.tensor[string]) -> example_spec nest of tensors