MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / observation_spec

Method observation_spec

dm_control/rl/control.py:137–153  ·  view source on GitHub ↗

Returns the observation specification for this environment. Infers the spec from the observation, unless the Task implements the `observation_spec` method. Returns: An dict mapping observation name to `ArraySpec` containing observation shape and dtype.

(self)

Source from the content-addressed store, hash-verified

135 return self._task.step_spec(self._physics)
136
137 def observation_spec(self):
138 """Returns the observation specification for this environment.
139
140 Infers the spec from the observation, unless the Task implements the
141 `observation_spec` method.
142
143 Returns:
144 An dict mapping observation name to `ArraySpec` containing observation
145 shape and dtype.
146 """
147 try:
148 return self._task.observation_spec(self._physics)
149 except NotImplementedError:
150 observation = self._task.get_observation(self._physics)
151 if self._flat_observation:
152 observation = flatten_observation(observation)
153 return _spec_from_observation(observation)
154
155 @property
156 def physics(self):

Callers

nothing calls this directly

Calls 4

flatten_observationFunction · 0.85
_spec_from_observationFunction · 0.85
observation_specMethod · 0.45
get_observationMethod · 0.45

Tested by

no test coverage detected