code: def test_r1_regulatization_sequence_input_jacobian_random(self):
      layer_weights = np.random.uniform(-1, 1, size=(50, 1)).astype(
          np.float32
      )
      real_data = (
          tf.ones(shape=(1, 5, 5), dtype=tf.float32),
          tf.ones(shape=(1, 5, 5), dtype=tf.float32),
      )
  
      def r1_regulatization_fn(weights):
          def multiply(input_tensor):
              return tf.linalg.matmul(input_tensor, weights)
  
          discriminator = tf.keras.Sequential()
          discriminator.add(tf.keras.layers.Concatenate())
          discriminator.add(tf.keras.layers.Reshape((50,)))
          # To simulate a dense layer a lambda layer is used, such that we are able
          # to feed the weights in as numpy array to the assert_jacobian_fn.
          discriminator.add(tf.keras.layers.Lambda(multiply))
  
          return losses.r1_regularization(
              real_data=real_data, discriminator=discriminator
          )
  
      with self.subTest(name="is_correct"):
          self.assert_jacobian_is_correct_fn(
              r1_regulatization_fn,
              (layer_weights,),
              delta=0.001,
              atol=0.01,
          )
      with self.subTest(name="is_finite"):
          self.assert_jacobian_is_finite_fn(
              r1_regulatization_fn, (layer_weights,)
          )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_graphics.projects.gan import losses
  from tensorflow_graphics.util import test_case
label_desc: Use image node_id 16 for calling the LossesTest obj's underlying member method code with example usage: obj.test_r1_regulatization_sequence_input_jacobian_random() and returns: losses, tf