code: def to_transitions(self) -> 'Transitions':
          
          # No need to propagate 'rollout_tensors' as they won't mean anything
          return Transitions(
              size=self.num_steps * self.num_envs,
              environment_information=
                  [ei for l in self.environment_information for ei in l]
                  if self.environment_information is not None else None,
              transition_tensors={
                  name: tensor_util.merge_first_two_dims(t) for name, t in self.transition_tensors.items()
              },
              extra_data=self.extra_data
          )
docs: Convert given rollout to Transitions