def num_time_steps(self):
    """Returns the number of time-steps in completed and incomplete trajectories."""

    num_time_steps = sum(BatchTrajectory._trajectory_lengths(self.trajectories))
    return num_time_steps + self.num_completed_time_steps
Returns the number of time-steps in completed and incomplete trajectories.
tensor2tensor/envs/trajectory.py