code: def matmul(
      x1: Union[ivy.Array, ivy.NativeArray],
      x2: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      transpose_a: bool = False,
      transpose_b: bool = False,
      adjoint_a: bool = False,
      adjoint_b: bool = False,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Compute the matrix product.
  
      Parameters
      ----------
      x1
          first input array. Should have a numeric data type. Must have at least one
          dimension.
      x2
          second input array. Should have a numeric data type. Must have at least one
          dimension.
      transpose_a
          if True, ``x1`` is transposed before multiplication.
      transpose_b
          if True, ``x2`` is transposed before multiplication.
      adjoint_a
          If True, takes the conjugate of the matrix then the transpose of the matrix.
          adjoint_a and transpose_a can not be true at the same time.
      adjoint_b
          If True, takes the conjugate of the matrix then the transpose of the matrix.
          adjoint_b and transpose_b can not be true at the same time.
      out
          optional output array, for writing the result to. It must have a shape that the
          inputs broadcast to.
  
      Returns
      -------
      ret
          -   if both x1 and x2 are one-dimensional arrays having shape (N,), a
              zero-dimensional array containing the inner product as its only element.
  
          -   if x1 is a two-dimensional array having shape (M, K) and x2 is a
              two-dimensional array having shape (K, N), a two-dimensional array
  
              containing the conventional matrix product and having shape (M, N).
          -   if x1 is a one-dimensional array having shape (K,) and x2 is an array having
              shape (..., K, N), an array having shape (..., N) (i.e., prepended
              dimensions during vector-to-matrix promotion must be removed) and containing
              the conventional matrix product.
  
          -   if x1 is an array having shape (..., M, K) and x2 is a one-dimensional array
              having shape (K,), an array having shape (..., M) (i.e., appended dimensions
              during vector-to-matrix promotion must be removed) and containing the
              conventional matrix product.
  
          -   if x1 is a two-dimensional array having shape (M, K) and x2 is an array
              having shape (..., K, N), an array having shape (..., M, N) and containing
              the conventional matrix product for each stacked matrix.
  
          -   if x1 is an array having shape (..., M, K) and x2 is a two-dimensional array
              having shape (K, N), an array having shape (..., M, N) and containing the
              conventional matrix product for each stacked matrix.
  
          -   if either x1 or x2 has more than two dimensions, an array having a shape
              determined by Broadcasting shape(x1)[:-2] against shape(x2)[:-2] and
              containing the conventional matrix product for each stacked matrix.
  
  
      **Raises**
  
          -   if either x1 or x2 is a zero-dimensional array.
  
          -   if x1 is a one-dimensional array having shape (K,), x2 is a one-dimensional
  
              array having shape (L,), and K != L.
  
          -   if x1 is a one-dimensional array having shape (K,), x2 is an array
              having shape (..., L, N), and K != L.
  
          -   if x1 is an array having shape (..., M, K), x2 is a one-dimensional array
              having shape (L,), and K != L.
  
          -   if x1 is an array having shape (..., M, K), x2 is an array having shape
              (..., L, N), and K != L.
  
  
      This function conforms to the `Array API Standard
      <https://data-apis.org/array-api/latest/>`_. This docstring is an extension of the
      `docstring <https://data-apis.org/array-api/latest/
      extensions/generated/array_api.linalg.matmul.html>`_
      in the standard.
  
      Both the description and the type hints above assumes an array input for simplicity,
      but this function is *nestable*, and therefore also accepts :class:`ivy.Container`
      instances in place of any of the arguments.
  
      Examples
      --------
      With :class:`ivy.Array` inputs:
  
      >>> x = ivy.array([2., 0., 3.])
      >>> y = ivy.array([4., 1., 8.])
      >>> z = ivy.matmul(x, y)
      >>> print(z)
      ivy.array(32.)
  
      >>> x = ivy.array([[1., 2.], [0., 1.]])
      >>> y = ivy.array([[2., 0.], [0., 3.]])
      >>> z = ivy.matmul(x, y, transpose_b=True)
      >>> print(z)
      ivy.array([[2., 6.],
             [0., 3.]])
  
      With :class:`ivy.Container` inputs:
  
      >>> x = ivy.Container(a=ivy.array([5., 1.]), b=ivy.array([1., 0.]))
      >>> y = ivy.Container(a=ivy.array([4., 7.]), b=ivy.array([3., 0.]))
      >>> z = ivy.matmul(x,y)
      >>> print(z)
      {
          a: ivy.array(27.),
          b: ivy.array(3.)
      }
  
      With a combination of :class:`ivy.Array`
      and :class:`ivy.Container` inputs:
  
      >>> x = ivy.array([9., 0.])
      >>> y = ivy.Container(a=ivy.array([2., 1.]), b=ivy.array([1., 0.]))
      >>> z = ivy.matmul(x, y)
      >>> print(z)
      {
          a: ivy.array(18.),
          b: ivy.array(9.)
      }
  
      >>> x = ivy.array([[1., 2.], [0., 3.]])
      >>> y = ivy.array([[1.], [3.]])
      >>> z = ivy.matmul(x, y, transpose_a=True)
      >>> print(z)
      ivy.array([[ 1.],
         [11.]])
      """
      return current_backend(x1).matmul(
          x1,
          x2,
          transpose_a=transpose_a,
          transpose_b=transpose_b,
          adjoint_a=adjoint_a,
          adjoint_b=adjoint_b,
          out=out,
      )
  
imports: from typing import Union, Optional, Tuple, Literal, List, Sequence
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 10 for calling a global function with example usage: matmul() and returns: current_backend