def METHOD_NAME(self) -> None:
    # test partial clipping
    max_gradient = 2.0
    param_1 = Variable(torch.tensor([1.0, 2.0]), requires_grad=True)
    param_2 = Variable(torch.tensor([2.0, 4.0]), requires_grad=True)
    keyed_optimizer = DummyKeyedOptimizer(
        {"param_1": param_1, "param_2": param_2},
        {},
        [{"params": [param_1]}, {"params": [param_2]}],
    )
    gradient_clipping_optimizer = GradientClippingOptimizer(
        optimizer=keyed_optimizer,
        max_gradient=max_gradient,
        clipping=GradientClipping.VALUE,
    )
    gradient_clipping_optimizer.zero_grad()
    param_1.grad = torch.tensor([2.0, 4.0])
    param_2.grad = torch.tensor([4.0, 8.0])
    gradient_clipping_optimizer.step()
    expected_grad_1 = torch.tensor([2.0, 2.0])
    expected_grad_2 = torch.tensor([2.0, 2.0])
    # pyre-fixme[6]: For 1st argument expected `Tensor` but got `Optional[Tensor]`.
    self.assertTrue(torch.allclose(param_1.grad, expected_grad_1))
    # pyre-fixme[6]: For 1st argument expected `Tensor` but got `Optional[Tensor]`.
    self.assertTrue(torch.allclose(param_2.grad, expected_grad_2))