class_docstr: Class that validates and converts other data types to Trajectory.
  
  Note that validation and conversion allows values to contain dictionaries
  with extra keys as compared to the the specs in the data context.  These
  additional entries / observations are ignored and dropped during conversion.
  
  This non-strict checking allows users to provide additional info and
  observation keys at input without having to manually prune them before
  converting.
class_docstr_tok: ["Class","that","validates","and","converts","other","data","types","to","Trajectory",".","Note","that","validation","and","conversion","allows","values","to","contain","dictionaries","with","extra","keys","as","compared","to","the","the","specs","in","the","data","context",".","These","additional","entries","\/","observations","are","ignored","and","dropped","during","conversion",".","This","non-strict","checking","allows","users","to","provide","additional","info","and","observation","keys","at","input","without","having","to","manually","prune","them","before","converting","."]
docstr: Create the AsTrajectory converter.
  
  Args:
    data_context: An instance of `DataContext`, typically accessed from the
      `TFAgent.data_context` property.
    sequence_length: The required time dimension value (if any), typically
      determined by the subclass of `TFAgent`.
    num_outer_dims: Expected number of outer dimensions.  Either 1 or 2. If
      `1`, call expects an outer batch dimension.  If `2`, then call expects
      the two outer dimensions `[batch, time]`.
code: def __init__(
      self,
      data_context: DataContext,
      sequence_length: typing.Optional[int] = None,
      num_outer_dims: te.Literal[
          1, 2
      ] = 2,  # pylint: disable=bad-whitespace
  ):
      """Create the AsTrajectory converter.
  
      Args:
        data_context: An instance of `DataContext`, typically accessed from the
          `TFAgent.data_context` property.
        sequence_length: The required time dimension value (if any), typically
          determined by the subclass of `TFAgent`.
        num_outer_dims: Expected number of outer dimensions.  Either 1 or 2. If
          `1`, call expects an outer batch dimension.  If `2`, then call expects
          the two outer dimensions `[batch, time]`.
      """
      self._data_context = data_context
      self._sequence_length = sequence_length
      self._num_outer_dims = num_outer_dims
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import typing
  import tensorflow
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import policy_step
  from tf_agents.trajectories import time_step
  from tf_agents.trajectories import trajectory
  from tf_agents.typing import types
  from tf_agents.utils import composite
  from tf_agents.utils import nest_utils
  import typing_extensions
label_desc: Use image node_id 1 to create a new AsTrajectory object from inherited base classes: tf with example: obj = AsTrajectory(data_context, sequence_length, num_outer_dims)