code: def dot_adjoint_0(B, G, A_meta, B_meta):
      _, A_ndim, A_dtype, _ = A_meta
      _, B_ndim, _, _ = B_meta
      if B_ndim == 0 or B_ndim == 1 or A_ndim == 0:
          contract_num = max(0, B_ndim - (A_ndim != 0))
          out = onp.tensordot(G, B, contract_num)
      else:
          out = onp.tensordot(G, onp.swapaxes(B, -1, -2), B_ndim - 1)
      return onp.asarray(out, dtype=A_dtype)
  
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 23 for calling a global function with example usage: dot_adjoint_0(B, G, A_meta, B_meta) and returns: onp