code: def test_exploding_optimizer_state():
      weight = (
          torch.tensor([[float("inf")]]).half().cuda().requires_grad_()
      )
      input = torch.tensor([1.0]).half().cuda().requires_grad_()
  
      optimizer = Adam([weight], lr=1e-3, precision=Precision.PURE_FP16)
      optimizer._optim_scale = 1.0
  
      optimizer.zero_grad()
      loss = (weight.mv(input)).pow(2).sum()
      loss.backward()
      with pytest.raises(RuntimeError):
          optimizer.step()
  
imports: from copy import deepcopy
  import functools
  import pytest
  import torch
label_desc: Use image node_id 20 for calling a global function with example usage: test_exploding_optimizer_state() without return types