class_docstr: Internal container for a batched stack.
  
  The implementation is a preallocated array and a (batched) stack
  pointer.
  
  The namedtuple structure exposes the full state of the stack, and is useful
  for testing, passing through flatten/unflatten operations, and general
  symmetry with the TensorFlow backend.
class_docstr_tok: ["Internal","container","for","a","batched","stack",".","The","implementation","is","a","preallocated","array","and","a","(","batched",")","stack","pointer",".","The","namedtuple","structure","exposes","the","full","state","of","the","stack",",","and","is","useful","for","testing",",","passing","through","flatten\/unflatten","operations",",","and","general","symmetry","with","the","TensorFlow","backend","."]
docstr: Pops each indicated batch member, returning a previous write.
  
  Args:
    mask: Boolean array of shape `[batch_size]`. The threads at `True`
      indices of `mask` will have their frame pointers regressed by 1.
  
  Returns:
    stack: Updated variable. Does not mutate `self`.
    read: The new top of the stack, after regressing the frame pointers
      indicated by `mask`.
  
  Raises:
    ValueError: On an attempt to pop the last value off a batch member.
docstr_tok: ["Pops","each","indicated","batch","member",",","returning","a","previous","write",".","Args",":","mask",":","Boolean","array","of","shape","`","[","batch_size","]","`",".","The","threads","at","`","True","`","indices","of","`","mask","`","will","have","their","frame","pointers","regressed","by","1",".","Returns",":","stack",":","Updated","variable",".","Does","not","mutate","`","self","`",".","read",":","The","new","top","of","the","stack",",","after","regressing","the","frame","pointers","indicated","by","`","mask","`",".","Raises",":","ValueError",":","On","an","attempt","to","pop","the","last","value","off","a","batch","member","."]
code: def pop(self, mask):
      """Pops each indicated batch member, returning a previous write.
  
      Args:
        mask: Boolean array of shape `[batch_size]`. The threads at `True`
          indices of `mask` will have their frame pointers regressed by 1.
  
      Returns:
        stack: Updated variable. Does not mutate `self`.
        read: The new top of the stack, after regressing the frame pointers
          indicated by `mask`.
  
      Raises:
        ValueError: On an attempt to pop the last value off a batch member.
      """
      new_stack_index = self.stack_index - mask
      if np.any(new_stack_index < 0):
          raise ValueError("Popping the last value off a stack.")
      batch_size = self.stack_index.shape[0]
      # stack:       [max_stack_depth * batch_size, ...]
      # stack_index:                   [batch_size]
      # returns:                       [batch_size, ...]
      indices = new_stack_index * batch_size + np.arange(batch_size)
      return (
          Stack(self.stack, new_stack_index),
          np.take(self.stack, indices, axis=0),
      )
  
imports: import collections
  import numpy
  from tensorflow_probability.python.experimental.auto_batching import instructions
label_desc: Use image node_id 1 for calling the Stack obj's underlying member method code with example usage: obj.pop(mask) and returns: Stack,  np