code: def test_multi_iter_gen_adv_neighbor_not_knowing_input_in_advance(
      self,
  ):
      @tf.function
      def _gen_adv_neighbor(x):
          w = tf.constant([[3.0], [4.0]])
          loss = tf.matmul(x, w)
          y = tf.constant([0.0])
          model_fn = lambda inp: tf.matmul(inp, w)
  
          @tf.function
          def loss_fn(_, pred):
              return pred
  
          adv_config = configs.AdvNeighborConfig(
              feature_mask=None,
              adv_step_size=0.1,
              adv_grad_norm="l2",
              pgd_epsilon=0.15,
              pgd_iterations=2,
          )
          adv_neighbor, _ = adv_lib.gen_adv_neighbor(
              x,
              loss,
              adv_config,
              pgd_labels=y,
              pgd_model_fn=model_fn,
              pgd_loss_fn=loss_fn,
          )
          return adv_neighbor
  
      x = tf.constant([[1.0, 1.0], [0.0, 0.0], [-1.0, -1.0]])
      actual_neighbor = self.evaluate(_gen_adv_neighbor(x))
  
      # gradient = w
      # perturbation = 2 * adv_step_size * normalize(gradient) = [0.12, 0.16]
      # Clipping perturbation to 0.15 epsilon gives [0.09, 0.12].
      expected_neighbor = [[1.09, 1.12], [0.09, 0.12], [-0.91, -0.88]]
      self.assertAllClose(expected_neighbor, 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 39 for calling the GenAdvNeighborTest obj's underlying member method code with example usage: obj.test_multi_iter_gen_adv_neighbor_not_knowing_input_in_advance() and returns: adv_neighbor, pred