class_docstr: Class that validates and converts other data types to HalfTransition.
  
  HalfTransition is a special Transition whose next_time_step contains a dummy
  observation.
  
  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","HalfTransition",".","HalfTransition","is","a","special","Transition","whose","next_time_step","contains","a","dummy","observation",".","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: Create 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.
code: def __init__(self, data_context: DataContext, squeeze_time_dim=False):
      """Create 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.
      """
      self._data_context = data_context
      self._squeeze_time_dim = squeeze_time_dim
  
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 AsHalfTransition object from inherited base classes: tf with example: obj = AsHalfTransition(data_context, squeeze_time_dim)