code: def test_gradient_norms_on_various_models(
      self,
      input_dim,
      output_dim,
      per_example_loss_fn,
      num_microbatches,
      is_eager,
      partial,
      weighted,
  ):
      registry = layer_registry.make_default_layer_registry()
      registry.insert(DoubleDense, double_dense_layer_computation)
      x_batches, weight_batches = common_test_utils.get_nd_test_batches(
          input_dim
      )
      for x_batch, weight_batch in zip(x_batches, weight_batches):
          batch_size = x_batch.shape[0]
          if (
              num_microbatches is not None
              and batch_size % num_microbatches != 0
          ):
              continue
          (
              computed_norms,
              true_norms,
          ) = common_test_utils.get_computed_and_true_norms(
              model_generator=common_test_utils.make_two_layer_functional_model,
              layer_generator=lambda a, b: DoubleDense(*b),
              input_dims=[input_dim],
              output_dims=[output_dim],
              per_example_loss_fn=per_example_loss_fn,
              num_microbatches=num_microbatches,
              is_eager=is_eager,
              x_batch=x_batch,
              weight_batch=weight_batch if weighted else None,
              registry=registry,
              partial=partial,
          )
          self.assertEqual(
              computed_norms.shape[0], num_microbatches or batch_size
          )
          self.assertAllClose(
              computed_norms, true_norms, rtol=1e-3, atol=1e-2
          )
  
imports: from collections.abc import Mapping, Sequence
  from typing import Any, Optional
  from absl.testing import parameterized
  import tensorflow
  from tensorflow_privacy.privacy.fast_gradient_clipping import clip_grads
  from tensorflow_privacy.privacy.fast_gradient_clipping import common_test_utils
  from tensorflow_privacy.privacy.fast_gradient_clipping import layer_registry
  from tensorflow_privacy.privacy.fast_gradient_clipping import type_aliases
label_desc: Use image node_id 1 for calling the CustomLayerTest obj's underlying member method code with example usage: obj.test_gradient_norms_on_various_models(input_dim, output_dim, per_example_loss_fn, num_microbatches, is_eager, partial, weighted) without return types