code: def test_raises_on_inf(self):
      params = make_params(5, num_dims=[1])
      params[2].grad[-1] = float("inf")
      self.assertRaises(
          RuntimeError,
          clip_grad_norm_,
          params,
          1.0,
          error_if_nonfinite=True,
      )
  
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 11 for calling the ClipGradNormTest obj's underlying member method code with example usage: obj.test_raises_on_inf() without return types