in gym3/trajectory_recorder.py [0:0]
def _new_trajectory_dict(self):
assert self._ob_actual_dtype is not None, (
"Not supposed to happen; self._ob_actual_dtype should have been set"
" in the first act() call before _new_trajectory_dict is called"
)
traj_dict = dict(
reward=list(),
ob=zeros(self.env.ob_space, (0,)),
info=list(),
act=zeros(self.env.ac_space, (0,)),
)
traj_dict["ob"] = multimap(
lambda arr, my_dtype: arr.astype(my_dtype),
traj_dict["ob"],
self._ob_actual_dtype,
)
traj_dict["act"] = multimap(
lambda arr, my_dtype: arr.astype(my_dtype),
traj_dict["act"],
self._ac_actual_dtype,
)
return traj_dict