code: def get_reference_grad(i, w, ops):
      # Creating new tensors ensures, among other things, that the new tensors are not in the cache.
      # In fact, they are guaranteed not to use the cache because they are not torch.nn.Parameters.
      fp32_i = i.detach().clone().float()
      fp32_w = w.detach().clone().float().requires_grad_()
      loss = ops(fp32_i, fp32_w)
      loss.backward()
      return fp32_w.grad
  
imports: import unittest
  import functools
  import itertools
  from apex import amp
  from apex.amp import _amp_state
  import torch
  from torch import nn
  import torch.nn.functional
  from utils import common_init, HALF, FLOAT, ALWAYS_HALF, ALWAYS_FLOAT, MATCH_INPUT
label_desc: Use image node_id 1 for calling a global function with example usage: get_reference_grad(i, w, ops) and returns: fp32_w