code: def gather_sparse(a, indices, axis=0, mask=None):
      """
      SparseTensor equivalent to tf.gather, assuming indices are sorted.
      :param a: SparseTensor of rank k and nnz non-zeros.
      :param indices: rank-1 int Tensor, rows or columns to keep.
      :param axis: int axis to apply gather to.
      :param mask: boolean mask corresponding to indices. Computed if not provided.
      :return gathered_a: SparseTensor masked along the given axis.
      :return values_mask: bool Tensor indicating surviving values, shape [nnz].
      """
      in_size = _square_size(a.dense_shape)
      out_size = tf.size(indices)
      if mask is None:
          mask = ops.indices_to_mask(indices, in_size)
      inverse_map = _indices_to_inverse_map(indices, in_size)
      return _boolean_mask_sparse(
          a, mask, axis=axis, inverse_map=inverse_map, out_size=out_size
      )
  
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 9 for calling a global function with example usage: gather_sparse(a, indices, axis, mask) and returns: _boolean_mask_sparse