class_docstr: Tests for _compute_gradients method.
class_docstr_tok: ["Tests","for","_compute_gradients","method","."]
code: def testNoiseMultiplier(
      self,
      optimizer_class,
      l2_norm_clip,
      noise_multiplier,
      num_microbatches,
      requires_varlist,
  ):
      var0 = tf.Variable(tf.zeros([1000], dtype=tf.float32))
      data0 = tf.Variable(tf.zeros([16, 1000], dtype=tf.float32))
  
      varlist_kwarg = (
          {"var_list_or_model": [var0]} if requires_varlist else {}
      )
  
      optimizer = optimizer_class(
          l2_norm_clip=l2_norm_clip,
          noise_multiplier=noise_multiplier,
          num_microbatches=num_microbatches,
          **varlist_kwarg,
          learning_rate=2.0,
      )
  
      loss = lambda: self._loss(data0, var0)
      grads_and_vars = optimizer._compute_gradients(loss, [var0])
      grads = grads_and_vars[0][0].numpy()
  
      # Test standard deviation is close to l2_norm_clip * noise_multiplier.
  
      self.assertNear(
          np.std(grads),
          l2_norm_clip * noise_multiplier / num_microbatches,
          0.5,
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow import estimator
  from tensorflow_privacy.privacy.optimizers import dp_optimizer_keras
  from tensorflow_privacy.privacy.optimizers import dp_optimizer_keras_vectorized
label_desc: Use image node_id 9 for calling the DPOptimizerComputeGradientsTest obj's underlying member method code with example usage: obj.testNoiseMultiplier(optimizer_class, l2_norm_clip, noise_multiplier, num_microbatches, requires_varlist) without return types