code: def test_densify_gradients(self, densify_gradients):
      e = embed.Embed(1, densify_gradients=densify_gradients)
      with tf.GradientTape() as tape:
          y = e([0])
          dy = tape.gradient(y, e.embeddings)
      if densify_gradients:
          self.assertIsInstance(dy, tf.Tensor)
      else:
          self.assertIsInstance(dy, tf.IndexedSlices)
  
file_path: sonnet/sonnet/src/embed_test.py
imports: from absl.testing import parameterized
  from sonnet.src import embed
  from sonnet.src import initializers
  from sonnet.src import test_utils
  import tensorflow
label_desc: Use image node_id 4 for calling the EmbedTest obj's underlying member method code with example usage: obj.test_densify_gradients(densify_gradients) without return types