code: def _compute_stacked_offsets(sizes, repeats):
      """Computes offsets to add to indices of stacked tensors (Tensorflow).
  
      When a set of tensors are stacked, the indices of those from the second on
      must be offset in order to be able to index into the stacked tensor. This
      computes those offsets.
  
      Args:
        sizes: A 1D `Tensor` of the sizes per graph.
        repeats: A 1D `Tensor` of the number of repeats per graph.
  
      Returns:
        A 1D `Tensor` containing the index offset per graph.
      """
      sizes = tf.cast(tf.convert_to_tensor(sizes[:-1]), tf.int32)
      offset_values = tf.cumsum(tf.concat([[0], sizes], 0))
      return repeat(offset_values, repeats)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import functools
  from absl import logging
  from graph_nets import graphs
  from graph_nets import utils_np
  import six
  from six.moves import range
  import tensorflow
  import tree
label_desc: Use image node_id 7 for calling a global function with example usage: _compute_stacked_offsets(sizes, repeats) and returns: repeat