code: def grad_inner(argnum, ans, A, B):
      A_ndim, B_ndim = anp.ndim(A), anp.ndim(B)
      if A_ndim == 0 or B_ndim == 0:
          axes = ([], [])
      else:
          axes = ([A_ndim - 1], [B_ndim - 1])
      if argnum == 0:
          return lambda G: tensordot_adjoint_0(
              B, G, axes, A_ndim, B_ndim
          )
      elif argnum == 1:
          return lambda G: tensordot_adjoint_1(
              A, G, axes, A_ndim, B_ndim
          )
  
imports: from __future__ import absolute_import
  from six import string_types
  from functools import partial
  import numpy
  from ..util import func
  from .None import numpy_wrapper
  from .numpy_boxes import ArrayBox
  from autograd.extend import primitive, vspace, defvjp, defvjp_argnum, SparseObject, VJPNode, register_notrace
label_desc: Use image node_id 18 for calling a global function with example usage: grad_inner(argnum, ans, A, B) and returns: function, function