class_docstr: Class that validates and converts other data types to N-step Transition.
  
  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","N-step","Transition",".","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 AsNStepTransition converter.
  
  For more details on how `Trajectory` objects are converted to N-step
  `Transition` objects, see
  `tf_agents.trajectories.trajectory.to_n_step_transition`.
  
  Args:
    data_context: An instance of `DataContext`, typically accessed from the
      `TFAgent.data_context` property.
    gamma: A floating point scalar; the discount factor.
    n: (Optional.) The expected number of frames given a `Trajectory` input.
      Given a `Trajectory` with tensors shaped `[B, T, ...]`, we ensure that
      `T = n + 1`.  Only used for validation.
code: def __init__(
      self,
      data_context: DataContext,
      gamma: types.Float,
      n: typing.Optional[int] = None,
  ):
      """Create the AsNStepTransition converter.
  
      For more details on how `Trajectory` objects are converted to N-step
      `Transition` objects, see
      `tf_agents.trajectories.trajectory.to_n_step_transition`.
  
      Args:
        data_context: An instance of `DataContext`, typically accessed from the
          `TFAgent.data_context` property.
        gamma: A floating point scalar; the discount factor.
        n: (Optional.) The expected number of frames given a `Trajectory` input.
          Given a `Trajectory` with tensors shaped `[B, T, ...]`, we ensure that
          `T = n + 1`.  Only used for validation.
      """
      self._data_context = data_context
      self._gamma = gamma
      self._n = n
  
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 AsNStepTransition object from inherited base classes: tf with example: obj = AsNStepTransition(data_context, gamma, n)