code: def _boolean_mask_sparse(a, mask, axis, inverse_map, out_size):
      """
      SparseTensor equivalent to tf.boolean_mask.
      :param a: SparseTensor of rank k and nnz non-zeros.
      :param mask: rank-1 bool Tensor.
      :param axis: int, axis on which to mask. Must be in [-k, k).
      :param out_size: number of true entires in mask. Computed if not given.
      :return masked_a: SparseTensor masked along the given axis.
      :return values_mask: bool Tensor indicating surviving edges, shape [nnz].
      """
      mask = tf.convert_to_tensor(mask)
      values_mask = tf.gather(mask, a.indices[:, axis], axis=0)
      dense_shape = tf.tensor_scatter_nd_update(
          a.dense_shape, [[axis]], [out_size]
      )
      indices = tf.boolean_mask(a.indices, values_mask)
      indices = tf.unstack(indices, axis=-1)
      indices[axis] = tf.gather(inverse_map, indices[axis])
      indices = tf.stack(indices, axis=-1)
      a = tf.SparseTensor(
          indices,
          tf.boolean_mask(a.values, values_mask),
          dense_shape,
      )
      return (a, values_mask)
  
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 5 for calling a global function with example usage: _boolean_mask_sparse(a, mask, axis, inverse_map, out_size) and returns: a,  values_mask