@@ -156,11 +156,32 @@ def group_map(self, env: EnvBase) -> Dict[str, List[str]]:
156156 def observation_spec (self , env : EnvBase ) -> CompositeSpec :
157157 """
158158 A spec for the observation.
159- Must be a CompositeSpec with one (group_name, observation_key) entry per group .
159+ Must be a CompositeSpec with as many entries as needed nested under the ``group_name`` key .
160160
161161 Args:
162162 env (EnvBase): An environment created via self.get_env_fun
163163
164+ Examples:
165+ >>> print(task.observation_spec(env))
166+ CompositeSpec(
167+ agents: CompositeSpec(
168+ observation: CompositeSpec(
169+ image: UnboundedDiscreteTensorSpec(
170+ shape=torch.Size([8, 88, 88, 3]),
171+ space=ContinuousBox(
172+ low=Tensor(shape=torch.Size([8, 88, 88, 3]), device=cpu, dtype=torch.int64, contiguous=True),
173+ high=Tensor(shape=torch.Size([8, 88, 88, 3]), device=cpu, dtype=torch.int64, contiguous=True)),
174+ device=cpu,
175+ dtype=torch.uint8,
176+ domain=discrete),
177+ array: UnboundedContinuousTensorSpec(
178+ shape=torch.Size([8, 3]),
179+ space=None,
180+ device=cpu,
181+ dtype=torch.float32,
182+ domain=continuous), device=cpu, shape=torch.Size([8])), device=cpu, shape=torch.Size([8])), device=cpu, shape=torch.Size([]))
183+
184+
164185 """
165186 raise NotImplementedError
166187
0 commit comments