|View source on GitHub|
Converts gym spaces into array specs.
tf_agents.environments.gym_wrapper.spec_from_gym_space( space: gym.Space, dtype_map: Optional[Dict[gym.Space, np.dtype]] = None, simplify_box_bounds: bool = True, name: Optional[Text] = None ) ->
Gym does not properly define dtypes for spaces. By default all spaces set their type to float64 even though observations do not always return this type. See: https://github.com/openai/gym/issues/527
To handle this we allow a dtype_map for setting default types for mapping spaces to specs.
observations. Not sure that we have a need for this yet.
||gym.Space to turn into a spec.|
||A dict from spaces to dtypes to use as the default dtype.|
||Whether to replace bounds of Box space that are arrays with identical values with one number and rely on broadcasting.|
||Name of the spec.|
|A BoundedArraySpec nest mirroring the given space structure.|
||If there is an unknown space type.|