code: def tensordot(
      x1: torch.Tensor,
      x2: torch.Tensor,
      /,
      *,
      axes: Union[int, Tuple[List[int], List[int]]] = 2,
      out: Optional[torch.Tensor] = None,
  ) -> torch.Tensor:
      dtype = ivy.as_native_dtype(ivy.promote_types(x1.dtype, x2.dtype))
      # handle tensordot for axes==0
      # otherwise call with axes
      if axes == 0:
          ret = (x1.reshape(x1.size() + (1,) * x2.dim()) * x2).type(
              dtype
          )
      else:
          ret = torch.tensordot(x1, x2, dims=axes).type(dtype)
      return ret
  
imports: import torch
  from typing import Union, Optional, Tuple, Literal, List, NamedTuple, Sequence
  from collections import namedtuple
  import ivy
  from ivy import inf
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from .None import backend_version
  from .elementwise import _cast_for_unary_op
label_desc: Use image node_id 23 for calling a global function with example usage: tensordot() and returns: ret