code: def _create_stack(max_stack_depth, value):
      """Creates a new Stack instance.
  
      Args:
        max_stack_depth: Python `int` indicating the depth of stack we
          should pre-allocate.
        value: An `ndarray`, the shape of a batch of values in a single frame.
  
      Returns:
        A new, initialized Stack object.
      """
      batch_size = value.shape[0]
      stack_index = np.zeros([batch_size], dtype=np.int64)
      stack = np.zeros(
          (max_stack_depth * batch_size,) + value.shape[1:],
          dtype=value.dtype,
      )
      return Stack(stack, stack_index)
  
imports: import collections
  import numpy
  from tensorflow_probability.python.experimental.auto_batching import instructions
label_desc: Use image node_id 1 for calling a global function with example usage: _create_stack(max_stack_depth, value) and returns: Stack