class_docstr: Class that validates and converts other data types to Transition.
  
  Note that validation and conversion allows values to contain dictionaries
  with extra keys as compared to 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","Transition",".","Note","that","validation","and","conversion","allows","values","to","contain","dictionaries","with","extra","keys","as","compared","to","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: Creates the AsTransition converter.
  
  Args:
    data_context: An instance of `DataContext`, typically accessed from the
      `TFAgent.data_context` property.
    squeeze_time_dim: Whether to emit a transition without time dimensions. If
      `True`, incoming trajectories are expected to have a time dimension of
      exactly `2`, and emitted Transitions will have no time dimensions.
    prepend_t0_to_next_time_step: Whether to add t0 to next_time_step. This
      option is useful when using sequential model and can allow target
      network be able to take more information. Resulting shape of
      time_step.observation is `[B, T, ...]` and resulting shape of
      next_time_step.observation is `[B, T+1, ...]`.
code: def __init__(
      self,
      data_context: DataContext,
      squeeze_time_dim=False,
      prepend_t0_to_next_time_step=False,
  ):
      """Creates the AsTransition converter.
  
      Args:
        data_context: An instance of `DataContext`, typically accessed from the
          `TFAgent.data_context` property.
        squeeze_time_dim: Whether to emit a transition without time dimensions. If
          `True`, incoming trajectories are expected to have a time dimension of
          exactly `2`, and emitted Transitions will have no time dimensions.
        prepend_t0_to_next_time_step: Whether to add t0 to next_time_step. This
          option is useful when using sequential model and can allow target
          network be able to take more information. Resulting shape of
          time_step.observation is `[B, T, ...]` and resulting shape of
          next_time_step.observation is `[B, T+1, ...]`.
      """
      self._data_context = data_context
      self._squeeze_time_dim = squeeze_time_dim
      self._prepend_t0_to_next_time_step = prepend_t0_to_next_time_step
  
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 AsTransition object from inherited base classes: tf with example: obj = AsTransition(data_context, squeeze_time_dim, prepend_t0_to_next_time_step)