docs: def trajectory(self,
              horizon: int,
              initial_state: Optional[StateTensor] = None) -> TrajectoryOutput:
          '''Returns the ops for the trajectory generation with given `horizon`
          and `initial_state`.
  
          The simulation returns states, actions and interms as a
          sequence of tensors (i.e., all representations are factored).
          The reward is a batch sized tensor.
          The trajectoty output is a tuple: (initial_state, states, actions, interms, rewards).
          If initial state is None, use default compiler's initial state.
  
          Note:
              All tensors have shape: (batch_size, horizon, fluent_shape).
              Except initial state that has shape: (batch_size, fluent_shape).
  
          Args:
              horizon (int): The number of simulation timesteps.
              initial_state (Optional[Sequence[tf.Tensor]]): The initial state tensors.
  
          Returns:
              Tuple[StateTensor, StatesTensor, ActionsTensor, IntermsTensor, tf.Tensor]: Trajectory output tuple.
          '''
          if initial_state is None:
              initial_state = self._cell.initial_state()
  
          with self.graph.as_default():
              self.inputs = self.timesteps(horizon)
              outputs, _ = tf.nn.dynamic_rnn(
                                  self._cell,
                                  self.inputs,
                                  initial_state=initial_state,
                                  dtype=tf.float32,
                                  scope="trajectory")
              states, actions, interms, rewards = outputs
  
              # fluent types
              state_dtype = map(rddl2tf.utils.range_type_to_dtype, self._cell._compiler.rddl.state_range_type)
              states = self._output(states, state_dtype)
              interm_dtype = map(rddl2tf.utils.range_type_to_dtype, self._cell._compiler.rddl.interm_range_type)
              interms = self._output(interms, interm_dtype)
              action_dtype = map(rddl2tf.utils.range_type_to_dtype, self._cell._compiler.rddl.action_range_type)
              actions = self._output(actions, action_dtype)
  
              outputs = (initial_state, states, actions, interms, rewards)
  
          return outputs