code: def matmul(
      x1: torch.Tensor,
      x2: torch.Tensor,
      /,
      *,
      transpose_a: bool = False,
      transpose_b: bool = False,
      adjoint_a: bool = False,
      adjoint_b: bool = False,
      out: Optional[torch.Tensor] = None,
  ) -> torch.Tensor:
      # torch does not support inplace matmul (same storage in out=)
      # https://github.com/pytorch/pytorch/issues/58742
      # https://github.com/pytorch/pytorch/issues/48900
      if out is x1 or out is x2:
          out = None
      if transpose_a:
          x1 = torch.swapaxes(x1, -1, -2)
      if transpose_b:
          x2 = torch.swapaxes(x2, -1, -2)
      if adjoint_a:
          x1 = torch.adjoint(x1)
      if adjoint_b:
          x2 = torch.adjoint(x2)
      x1, x2 = ivy.promote_types_of_inputs(x1, x2)
      return torch.matmul(x1, x2, out=out)
  
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 9 for calling a global function with example usage: matmul() and returns: torch