code: def getGradientForOp(op):
      return core.GradientRegistry.GetGradientForOp(
          op, [s + "_grad" for s in op.output]
      )
  
file_path: pytorch/caffe2/python/gradient_checker.py
imports: import os
  import numpy
  from caffe2.python import core, workspace, net_drawer
  from caffe2.proto import caffe2_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: getGradientForOp(op) and returns: core