coopihczoo.teaching.scripts_to_sort.behavioral_cloning_original.unwrap_traj

coopihczoo.teaching.scripts_to_sort.behavioral_cloning_original.unwrap_traj(traj)[source]

Uses RolloutInfoWrapper-captured obs and rews to replace fields.

This can be useful for bypassing other wrappers to retrieve the original obs and rews.

Fails if infos is None or if the trajectory was generated from an environment without imitation.util.rollout.RolloutInfoWrapper

Args:

traj: A trajectory generated from RolloutInfoWrapper-wrapped Environments.

Returns:

A copy of traj with replaced obs and rews fields.