code: def test_multi_iter_gen_adv_neighbor_should_ignore_sparse_tensors(
      self,
  ):
      (
          x,
          w_sparse,
          w_dense,
          adv_config,
          model_fn,
          loss_fn,
      ) = (
          self._test_multi_iter_gen_adv_neighbor_should_ignore_sparse_tensors_setup()
      )
      y = tf.constant([0.0])
  
      prod_sparse = tf.reduce_sum(
          tf.sparse.sparse_dense_matmul(x["sparse"], w_sparse)
      )
      prod_dense = tf.reduce_sum(input_tensor=w_dense * x["dense"])
      loss = tf.abs(y - (prod_dense + prod_sparse))
  
      adv_neighbor, _ = adv_lib.gen_adv_neighbor(
          x,
          loss,
          adv_config,
          pgd_labels=y,
          pgd_model_fn=model_fn,
          pgd_loss_fn=loss_fn,
      )
      actual_neighbor = self.evaluate(adv_neighbor)
  
      # No perturbation on sparse features.
      actual_sparse = actual_neighbor["sparse"]
      self.assertAllEqual(
          x["sparse"].dense_shape, actual_sparse.dense_shape
      )
      self.assertAllEqual(x["sparse"].indices, actual_sparse.indices)
      self.assertAllClose(x["sparse"].values, actual_sparse.values)
      # gradient = w_dense
      # perturbation = adv_step_size * sign(w_dense) * 2 = 0.2, clipped to 0.13.
      self.assertAllClose([[-0.87], [1.13]], actual_neighbor["dense"])
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import neural_structured_learning.configs
  from neural_structured_learning.lib import adversarial_neighbor
  import numpy
  import tensorflow
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 27 for calling the GenAdvNeighborTest obj's underlying member method code with example usage: obj.test_multi_iter_gen_adv_neighbor_should_ignore_sparse_tensors() without return types