code: def vecdot(
      x1: torch.Tensor,
      x2: torch.Tensor,
      /,
      *,
      axis: int = -1,
      out: Optional[torch.Tensor] = None,
  ) -> torch.Tensor:
      dtype = ivy.as_native_dtype(ivy.promote_types(x1.dtype, x2.dtype))
      if dtype != "float64":
          x1, x2 = x1.to(dtype=torch.float32), x2.to(
              dtype=torch.float32
          )
      if ivy.exists(out):
          if ivy.as_ivy_dtype(out.dtype) == ivy.as_ivy_dtype(x1.dtype):
              return torch.tensordot(
                  x1, x2, dims=([axis], [axis]), out=out
              )
          return ivy.inplace_update(
              out,
              torch.tensordot(x1, x2, dims=([axis], [axis])).to(
                  out.dtype
              ),
          )
      return torch.tensordot(x1, x2, dims=([axis], [axis])).to(dtype)
  
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 25 for calling a global function with example usage: vecdot() and returns: torch, ivy, torch