code: def tensordot_adjoint_0(B, G, axes, A_ndim, B_ndim):
      # The adjoint of the operator
      # A |--> np.tensordot(A, B, axes)
      if B_ndim == 0:
          return G * B
  
      G_axes = onp.arange(onp.ndim(G))
      if type(axes) is int:
          axes = max(axes, 0)
          B_axes = onp.arange(B_ndim)
          return onp.tensordot(
              G, B, [G_axes[A_ndim - axes :], B_axes[axes:]]
          )
      else:
          axes0 = [axes[0]] if type(axes[0]) is int else axes[0]
          axes1 = [axes[1]] if type(axes[1]) is int else axes[1]
          axes = [axes0, axes1]
          A_axes = onp.arange(A_ndim)
          B_axes = onp.arange(B_ndim)
          summed_axes = [
              onp.asarray(axes[0], dtype="int64") % A_ndim,
              onp.asarray(axes[1], dtype="int64") % B_ndim,
          ]
          other_axes = [
              onp.delete(A_axes, summed_axes[0]),
              onp.delete(B_axes, summed_axes[1]),
          ]
          out = onp.tensordot(
              G, B, [G_axes[len(other_axes[0]) :], other_axes[1]]
          )
          perm = onp.argsort(
              onp.concatenate(
                  (
                      other_axes[0],
                      summed_axes[0][onp.argsort(summed_axes[1])],
                  )
              )
          )
          return onp.transpose(out, perm)
  
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 27 for calling a global function with example usage: tensordot_adjoint_0(B, G, axes, A_ndim, B_ndim) and returns: unknown, onp, onp