code: def test_raises_on_mismatch(self):
      # Construct different sets of parameters
      torch_params, apex_params = make_params(7, make_copy=True)
      with torch.no_grad():
          torch_params[0].grad.view(-1)[0] = 1.23
          apex_params[0].grad.view(-1)[0] = 3.21
  
      # Apply gradient clipping
      torch_norm = torch.nn.utils.clip_grad_norm_(
          torch_params,
          0.54321,
      )
      apex_norm = clip_grad_norm_(
          apex_params,
          0.54321,
      )
  
      # Make sure PyTorch and Apex get different results
      self.assertRaises(
          AssertionError,
          torch.testing.assert_close,
          apex_norm,
          torch_norm,
          rtol=1e-3,
          atol=1e-20,
          check_dtype=False,
      )
      for torch_p, apex_p in zip(torch_params, apex_params):
          self.assertRaises(
              AssertionError,
              torch.testing.assert_close,
              apex_p.grad,
              torch_p.grad,
              rtol=1e-3,
              atol=1e-20,
          )
  
file_path: apex/apex/contrib/test/clip_grad/test_clip_grad.py
imports: import random
  import unittest
  import torch
label_desc: Use image node_id 9 for calling the ClipGradNormTest obj's underlying member method code with example usage: obj.test_raises_on_mismatch() without return types