def reset(self, indices=None):
    """Reset the batch of environments.

    Args:
      indices: The batch indices of the environments to reset; defaults to all.

    Returns:
      Batch tensor of the new observations.
    """
    if indices is None:
      indices = tf.range(len(self._batch_env))
    observ_dtype = self._parse_dtype(self._batch_env.observation_space)
    observ = tf.py_func(
        self._batch_env.reset, [indices], observ_dtype, name='reset')
    observ = tf.check_numerics(observ, 'observ')
    reward = tf.zeros_like(indices, tf.float32)
    done = tf.zeros_like(indices, tf.bool)
    with tf.control_dependencies([
        tf.scatter_update(self._observ, indices, observ),
        tf.scatter_update(self._reward, indices, reward),
        tf.scatter_update(self._done, indices, done)]):
      return tf.identity(observ)
def reset ( self , indices = None ) : if indices is None : indices = tf . range ( len ( self . _batch_env ) ) observ_dtype = self . _parse_dtype ( self . _batch_env . observation_space ) observ = tf . py_func ( self . _batch_env . reset , [ indices ] , observ_dtype , name = 'reset' ) observ = tf . check_numerics ( observ , 'observ' ) reward = tf . zeros_like ( indices , tf . float32 ) done = tf . zeros_like ( indices , tf . bool ) with tf . control_dependencies ( [ tf . scatter_update ( self . _observ , indices , observ ) , tf . scatter_update ( self . _reward , indices , reward ) , tf . scatter_update ( self . _done , indices , done ) ] ) : return tf . identity ( observ )
Reset the batch of environments.

    Args:
      indices: The batch indices of the environments to reset; defaults to all.

    Returns:
      Batch tensor of the new observations.