code: def _indices_to_inverse_map(indices, size):
      """
      Compute inverse indices of a gather.
      :param indices: Tensor, forward indices, rank 1
      :param size: Tensor, size of pre-gathered input, rank 0
      :return: Tensor, inverse indices, shape [size]. Zero values everywhere
      except at indices.
      """
      indices = tf.cast(indices, tf.int64)
      size = tf.cast(size, tf.int64)
      return tf.scatter_nd(
          tf.expand_dims(indices, axis=-1),
          tf.range(tf.shape(indices, out_type=tf.int64)[0]),
          tf.expand_dims(size, axis=-1),
      )
  
file_path: spektral/spektral/layers/ops/sparse.py
imports: import tensorflow
  from tensorflow.python.ops import gen_sparse_ops
  from .None import ops
label_desc: Use image node_id 4 for calling a global function with example usage: _indices_to_inverse_map(indices, size) and returns: tf