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

tf_agents.utils.common.clip_to_spec

View source on GitHub

Clips value to a given bounded tensor spec.

tf_agents.utils.common.clip_to_spec(
    value, spec
)

Args:

  • value: (tensor) value to be clipped.
  • spec: (BoundedTensorSpec) spec containing min. and max. values for clipping.

Returns:

  • clipped_value: (tensor) value clipped to be compatible with spec.