code: def test_gen_adv_neighbor_respects_feature_constraints(
      self, gen_adv_neighbor_fn
  ):
      x = tf.constant([[0.0, 1.0]])
      w = tf.constant([[-1.0, 1.0]])
  
      loss_fn = lambda x: tf.linalg.matmul(x, w, transpose_b=True)
      adv_config = configs.AdvNeighborConfig(
          feature_mask=None,
          adv_step_size=0.1,
          adv_grad_norm="l2",
          clip_value_min=0.0,
          clip_value_max=1.0,
      )
      adv_neighbor = gen_adv_neighbor_fn(x, loss_fn, adv_config)
      actual_neighbor = self.evaluate(adv_neighbor)
      self.assertAllClose(x, actual_neighbor)
  
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 49 for calling the GenAdvNeighborTest obj's underlying member method code with example usage: obj.test_gen_adv_neighbor_respects_feature_constraints(gen_adv_neighbor_fn) without return types