def __init__(self, env):
    """Put an OpenAI Gym environment into the TensorFlow graph.

    Args:
      env: OpenAI Gym environment.
    """
    self._env = env
    observ_shape = self._parse_shape(self._env.observation_space)
    observ_dtype = self._parse_dtype(self._env.observation_space)
    action_shape = self._parse_shape(self._env.action_space)
    action_dtype = self._parse_dtype(self._env.action_space)
    with tf.name_scope('environment'):
      self._observ = tf.Variable(
          tf.zeros(observ_shape, observ_dtype), name='observ', trainable=False)
      self._action = tf.Variable(
          tf.zeros(action_shape, action_dtype), name='action', trainable=False)
      self._reward = tf.Variable(
          0.0, dtype=tf.float32, name='reward', trainable=False)
      self._done = tf.Variable(
          True, dtype=tf.bool, name='done', trainable=False)
      self._step = tf.Variable(
          0, dtype=tf.int32, name='step', trainable=False)
def __init__ ( self , env ) : self . _env = env observ_shape = self . _parse_shape ( self . _env . observation_space ) observ_dtype = self . _parse_dtype ( self . _env . observation_space ) action_shape = self . _parse_shape ( self . _env . action_space ) action_dtype = self . _parse_dtype ( self . _env . action_space ) with tf . name_scope ( 'environment' ) : self . _observ = tf . Variable ( tf . zeros ( observ_shape , observ_dtype ) , name = 'observ' , trainable = False ) self . _action = tf . Variable ( tf . zeros ( action_shape , action_dtype ) , name = 'action' , trainable = False ) self . _reward = tf . Variable ( 0.0 , dtype = tf . float32 , name = 'reward' , trainable = False ) self . _done = tf . Variable ( True , dtype = tf . bool , name = 'done' , trainable = False ) self . _step = tf . Variable ( 0 , dtype = tf . int32 , name = 'step' , trainable = False )
Put an OpenAI Gym environment into the TensorFlow graph.

    Args:
      env: OpenAI Gym environment.