code: def test_noise_is_computed_correctly(
      self,
      l2_norm_clip,
      noise_multiplier,
      batch_size,
      model_fn_reduction,
      noise_fn_reduction,
  ):
      # Skip invalid combinations.
      if model_fn_reduction is None and noise_fn_reduction is None:
          return
      if (
          model_fn_reduction is not None
          and noise_fn_reduction is not None
      ):
          return
      # Make an simple model container for storing the loss.
      if model_fn_reduction is not None:
          linear_model = tf.keras.Sequential([tf.keras.layers.Dense(1)])
          linear_model.compile(
              loss=tf.keras.losses.MeanSquaredError(
                  reduction=model_fn_reduction
              )
          )
      else:
          linear_model = None
      # The main computation is done on a deterministic dummy vector.
      num_units = 100
      clipped_grads = [
          tf.expand_dims(
              np.arange(num_units, dtype=np.float32), axis=-1
          )
      ]
      noised_grads = gradient_clipping_utils.add_aggregate_noise(
          clipped_grads,
          batch_size,
          l2_norm_clip,
          noise_multiplier,
          noise_fn_reduction,
          linear_model,
      )
      # The only measure that varies is the standard deviation of the variation.
      scale = (
          1.0
          if noise_fn_reduction == "sum" or model_fn_reduction == "sum"
          else 1.0 / batch_size
      )
      computed_std = np.std(noised_grads[0] - clipped_grads[0])
      expected_std = l2_norm_clip * noise_multiplier * scale
      self.assertNear(computed_std, expected_std, 0.1 * expected_std)
  
imports: from typing import Any
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_privacy.privacy.fast_gradient_clipping import gradient_clipping_utils
label_desc: Use image node_id 1 for calling the AddAggregateNoise obj's underlying member method code with example usage: obj.test_noise_is_computed_correctly(l2_norm_clip, noise_multiplier, batch_size, model_fn_reduction, noise_fn_reduction) without return types