ray.rllib.utils.tf_utils.get_placeholder#
- ray.rllib.utils.tf_utils.get_placeholder(*, space: gymnasium.Space | None = None, value: Any | None = None, name: str | None = None, time_axis: bool = False, flatten: bool = True) tensorflow.compat.v1.placeholder [source]#
Returns a tf1.placeholder object given optional hints, such as a space.
Note that the returned placeholder will always have a leading batch dimension (None).
- Parameters:
space – An optional gym.Space to hint the shape and dtype of the placeholder.
value – An optional value to hint the shape and dtype of the placeholder.
name – An optional name for the placeholder.
time_axis – Whether the placeholder should also receive a time dimension (None).
flatten – Whether to flatten the given space into a plain Box space and then create the placeholder from the resulting space.
- Returns:
The tf1 placeholder.