Sample batch of transitions and return them

def sample_transitions(self, batch_size, batch_info, discount_factor=None) -> Transitions:
        """ Sample batch of transitions and return them """
        indexes = self.backend.sample_batch_transitions(batch_size)
        transition_tensors = self.backend.get_transitions(indexes)

        return Trajectories(
            num_steps=batch_size,
            num_envs=self.backend.num_envs,
            environment_information=None,
            transition_tensors={k: torch.from_numpy(v) for k, v in transition_tensors.items()},
            rollout_tensors={}
        ).to_transitions()