class_docstr: A wrapper which stacks previously seen frames.
class_docstr_tok: ["A","wrapper","which","stacks","previously","seen","frames","."]
code: def _reset_non_empty(self, indices):
      # pylint: disable=protected-access
      new_values = self._batch_env._reset_non_empty(indices)
      # pylint: enable=protected-access
      initial_frames = getattr(
          self._batch_env, "history_observations", None
      )
  
      num_dimensions_in_env_observation = len(self.old_shape)
  
      if initial_frames is None:
          inx = [1, self.history] + (
              [1] * num_dimensions_in_env_observation
          )
          initial_frames = tf.tile(
              tf.expand_dims(new_values, axis=1), inx
          )
      with tf.control_dependencies([new_values]):
          assign_op = tf.scatter_update(
              self._observ, indices, initial_frames
          )
      with tf.control_dependencies([assign_op]):
          return tf.gather(self.observ, indices)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from six.moves import range
  from tensor2tensor.rl.envs.in_graph_batch_env import InGraphBatchEnv
  import tensorflow.compat.v1
label_desc: Use image node_id 5 for calling the StackWrapper obj's underlying member method code with example usage: obj._reset_non_empty(indices) and returns: tf