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: Convert `value` to an N-step Transition; validate data & prune.
  
  - If `value` is already a `Transition`, only validation is performed.
  - If `value` is a `Trajectory` with tensors containing a time dimension
    having `T != n + 1`, a `ValueError` is raised.
  
  Args:
    value: A `Trajectory` or `Transition` object to convert.
  
  Returns:
    A validated and pruned `Transition`.  If `squeeze_time_dim = True`,
    the resulting `Transition` has tensors with shape `[B, ...]`.  Otherwise,
    the tensors will have shape `[B, T - 1, ...]`.
  
  Raises:
    TypeError: If `value` is not one of `Trajectory` or `Transition`.
    ValueError: If `value` has structure that doesn't match the converter's
      spec.
    TypeError: If `value` has a structure that doesn't match the converter's
      spec.
    ValueError: If `n != None` and `value` is a `Trajectory`
      with a time dimension having value other than `T=n + 1`.
code: def __call__(self, value: typing.Any) -> trajectory.Transition:
      """Convert `value` to an N-step Transition; validate data & prune.
  
      - If `value` is already a `Transition`, only validation is performed.
      - If `value` is a `Trajectory` with tensors containing a time dimension
        having `T != n + 1`, a `ValueError` is raised.
  
      Args:
        value: A `Trajectory` or `Transition` object to convert.
  
      Returns:
        A validated and pruned `Transition`.  If `squeeze_time_dim = True`,
        the resulting `Transition` has tensors with shape `[B, ...]`.  Otherwise,
        the tensors will have shape `[B, T - 1, ...]`.
  
      Raises:
        TypeError: If `value` is not one of `Trajectory` or `Transition`.
        ValueError: If `value` has structure that doesn't match the converter's
          spec.
        TypeError: If `value` has a structure that doesn't match the converter's
          spec.
        ValueError: If `n != None` and `value` is a `Trajectory`
          with a time dimension having value other than `T=n + 1`.
      """
      if _is_transition_like(value):
          value = _as_tfa_transition(value)
      elif _is_trajectory_like(value):
          _validate_trajectory(
              value,
              self._data_context.trajectory_spec,
              sequence_length=None if self._n is None else self._n + 1,
          )
          value = trajectory.to_n_step_transition(
              value, gamma=self._gamma
          )
      else:
          raise TypeError("Input type not supported: {}".format(value))
  
      _validate_transition(
          value, self._data_context.transition_spec, num_outer_dims=1
      )
      value = nest_utils.prune_extra_keys(
          self._data_context.transition_spec, value
      )
      return value
  
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 2 for calling the AsNStepTransition obj's underlying member method code with example usage: obj.__call__(value) and returns: value