class_docstr: This is an abstract base class.
  Don't inherit from unittest.TestCase, and don't name it 'Test*'.
  Do, however, do these things in classes which inherit from this.
code: def test_global_norm_based_gradient_clipping(self):
      max_gradient_norm = 1.0
      model, perfect_model, data, label = self._createDense()
      opt = self.build_optimizer(
          model, max_gradient_norm=max_gradient_norm
      )
  
      params = []
      for param in model.GetParams(top_scope=True):
          if param in model.param_to_grad:
              if not isinstance(
                  model.param_to_grad[param],
                  core.GradientSlice,
              ):
                  params.append(param)
  
      workspace.FeedBlob("data", data[0])
      workspace.FeedBlob("label", label[0])
      workspace.RunNetOnce(model.param_init_net)
      workspace.CreateNet(model.net, True)
      self.assertIsNotNone(opt._lr_multiplier)
  
      # Run net once
      idx = np.random.randint(data.shape[0])
      workspace.FeedBlob("data", data[idx])
      workspace.FeedBlob("label", label[idx])
      workspace.RunNet(model.net.Proto().name)
  
      reference = self._gradient_ratio_reference(
          model,
          params,
          max_gradient_norm,
      )
      norm_ratio = workspace.FetchBlob(
          "norm_clipped_grad_update/norm_ratio"
      )
      np.testing.assert_almost_equal(norm_ratio, reference)
      self.assertTrue(
          reference < 1.0, "Bad test, gradient not being scaled."
      )
  
file_path: pytorch/caffe2/python/optimizer_test_util.py
imports: import unittest
  import numpy
  from caffe2.python import brew, core, workspace, cnn, optimizer
  from caffe2.python.modeling.initializers import Initializer, PseudoFP16Initializer
  from caffe2.python.model_helper import ModelHelper
label_desc: Use image node_id 2 for calling the LRModificationTestBase obj's underlying member method code with example usage: obj.test_global_norm_based_gradient_clipping() without return types