code: def inner(a, b):
      """Returns the inner product of two arrays.
  
      It uses the last axis of each argument to take sum product.
  
      Args:
          a (cupy.ndarray): The first argument.
          b (cupy.ndarray): The second argument.
  
      Returns:
          cupy.ndarray: The inner product of ``a`` and ``b``.
  
      .. seealso:: :func:`numpy.inner`
  
      """
      a_ndim = a.ndim
      b_ndim = b.ndim
      if a_ndim == 0 or b_ndim == 0:
          return cupy.multiply(a, b)
  
      a_axis = a_ndim - 1
      b_axis = b_ndim - 1
  
      if a.shape[-1] != b.shape[-1]:
          raise ValueError("Axis dimension mismatch")
  
      if a_axis:
          a = cupy.rollaxis(a, a_axis, 0)
      if b_axis:
          b = cupy.rollaxis(b, b_axis, 0)
  
      ret_shape = a.shape[1:] + b.shape[1:]
  
      k = a.shape[0]
      n = a.size // k
      m = b.size // k
  
      return _core.tensordot_core(a, b, None, n, m, k, ret_shape)
  
file_path: cupy/cupy/linalg/_product.py
imports: import collections.abc
  import numbers
  import numpy
  import cupy
  from cupy import _core
  from cupy._core import internal
  from cupy._core._gufuncs import _GUFunc
  from cupy.linalg import _solve
  from cupy.linalg import _util
label_desc: Use image node_id 4 for calling a global function with example usage: inner(a, b) and returns: _core, cupy