class_docstr: Immutable, internal container for a fixed size stack.
  
  The implementation is backed by a `Tensor` each for the stack and the
  (batched) stack pointer.
  
  As a namedtuple, it can be directly passed through TF's nest library for
  flattening and restructuring as an element passed to e.g. a TF while loop.
docstr: Pops each indicated batch member, returns the new top of the stack.
  
  Does not mutate `self`.
  
  Args:
    mask: Boolean `Tensor` of shape `[batch_size]`. The stack frames at `True`
      indices of `mask` are regressed; the others are unchanged.
    name: Optional name for this op.
  
  Returns:
    new_stack: A new stack whose frames have been regressed where indicated
        by `mask`.
    read: The batch of values at the newly-current stack frame.
docstr_tok: ["Pops","each","indicated","batch","member",",","returns","the","new","top","of","the","stack",".","Does","not","mutate","`","self","`",".","Args",":","mask",":","Boolean","`","Tensor","`","of","shape","`","[","batch_size","]","`",".","The","stack","frames","at","`","True","`","indices","of","`","mask","`","are","regressed",";","the","others","are","unchanged",".","name",":","Optional","name","for","this","op",".","Returns",":","new_stack",":","A","new","stack","whose","frames","have","been","regressed","where","indicated","by","`","mask","`",".","read",":","The","batch","of","values","at","the","newly-current","stack","frame","."]
code: def pop(self, mask, name=None):
      """Pops each indicated batch member, returns the new top of the stack.
  
      Does not mutate `self`.
  
      Args:
        mask: Boolean `Tensor` of shape `[batch_size]`. The stack frames at `True`
          indices of `mask` are regressed; the others are unchanged.
        name: Optional name for this op.
  
      Returns:
        new_stack: A new stack whose frames have been regressed where indicated
            by `mask`.
        read: The batch of values at the newly-current stack frame.
      """
      with tf.name_scope(name or "Stack.pop"):
          mask = tf.convert_to_tensor(value=mask, name="mask")
          new_stack_index = self.stack_index - tf.cast(
              mask, self.stack_index.dtype
          )
          if self._safety_checks():
              with tf.control_dependencies(
                  [
                      tf1.assert_greater_equal(
                          new_stack_index,
                          tf.constant(0, new_stack_index.dtype),
                      )
                  ]
              ):
                  new_stack_index = tf.identity(new_stack_index)
          new_stack_index.set_shape(self.stack_index.shape)
          # self.stack:      [max_stack_depth * batch_size, ...]
          # self.stack_index:                  [batch_size]
          # returned:                          [batch_size, ...]
          batch_size = (
              tf.compat.dimension_value(self.stack_index.shape[0])
              or tf.shape(
                  input=self.stack_index,
                  out_type=self.stack_index.dtype,
              )[0]
          )
          # Note that stack depth and batch are in a single dimension, stack major.
          gather_indices = new_stack_index * batch_size + tf.range(
              batch_size, dtype=new_stack_index.dtype
          )
          read_value = tf.gather(self.stack, gather_indices)
          read_value.set_shape(
              self.stack_index.shape.concatenate(self.stack.shape[1:])
          )
          return type(self)(self.stack, new_stack_index), read_value
  
imports: import collections
  import contextlib
  import six
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.auto_batching import instructions
  from tensorflow_probability.python.experimental.auto_batching import xla
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow.python.ops import control_flow_util
label_desc: Use image node_id 2 for calling the Stack obj's underlying member method code with example usage: obj.pop(mask, name) and returns: type,  read_value