code: def test_sparse_dropout():
      """Ensure SparseDropout.sparse_dropout gradients don't throw issues."""
      n = 5
      rate = 0.5
      with tf.GradientTape() as tape:
          values = tf.Variable(tf.random.uniform((n,)))
          tape.watch(values)
          st = tf.sparse.eye(5)
          st = tf.SparseTensor(st.indices, values, st.dense_shape)
          st = layers.SparseDropout(rate)(st, training=True)
          loss = tf.sparse.reduce_sum(st)
      grad = tape.gradient(loss, values)
      assert grad is not None
  
      _test_get_config(layers.SparseDropout, rate=rate)
  
file_path: spektral/tests/test_layers/test_base.py
imports: import numpy
  import scipy.sparse
  import tensorflow
  from spektral import layers
  from spektral.utils.sparse import sp_matrix_to_sp_tensor
  from tests.test_layers.convolutional.core import _test_get_config
label_desc: Use image node_id 2 for calling a global function with example usage: test_sparse_dropout() without return types