code: def random_sparse(shape, nnz):
      max_index = np.prod(shape)
      indices = np.random.choice(max_index, nnz, replace=False)
      indices.sort()
      indices = np.stack(np.unravel_index(indices, shape), axis=-1)
      return tf.SparseTensor(
          indices, np.random.normal(size=(nnz,)), shape
      )
  
imports: import numpy
  import scipy.sparse
  import tensorflow
  from spektral.data.utils import to_disjoint
  from spektral.layers import ops
  from spektral.utils import convolution
  from spektral.utils.sparse import sp_batch_to_sp_tensor, sp_matrix_to_sp_tensor
label_desc: Use image node_id 18 for calling a global function with example usage: random_sparse(shape, nnz) and returns: tf