code: def test_gen_adv_neighbor_to_raise_for_nondifferentiable_input_v2(
      self,
  ):
      (
          x,
          y,
          w,
          adv_config,
      ) = (
          self._test_gen_adv_neighbor_to_raise_for_nondifferentiable_input_setup()
      )
      with tf.GradientTape() as tape:
          tape.watch(x)
          x_stacked = tf.concat(
              [x["float"], tf.cast(x["int"], tf.dtypes.float32)], axis=1
          )
          y_hat = tf.matmul(x_stacked, w)
          loss = tf.math.squared_difference(y, y_hat)
  
      with self.assertRaisesRegex(ValueError, "Cannot perturb.*int"):
          adv_lib.gen_adv_neighbor(
              x,
              loss,
              adv_config,
              raise_invalid_gradient=True,
              gradient_tape=tape,
          )
  
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 34 for calling the GenAdvNeighborTest obj's underlying member method code with example usage: obj.test_gen_adv_neighbor_to_raise_for_nondifferentiable_input_v2() without return types