code: def irfft(x, n=None, axis=-1, overwrite_x=False):
      """Compute the one-dimensional inverse FFT for real input.
  
      Args:
          x (cupy.ndarray): Array to be transformed.
          n (None or int): Length of the transformed axis of the output. If ``n``
              is not given, the length of the input along the axis specified by
              ``axis`` is used.
          axis (int): Axis over which to compute the FFT.
          overwrite_x (bool): If True, the contents of ``x`` can be destroyed.
  
      Returns:
          cupy.ndarray:
              The transformed array.
  
      .. seealso:: :func:`scipy.fftpack.irfft`
  
      .. note::
         This function does not support a precomputed `plan`. If you need this
         capability, please consider using :func:`cupy.fft.irfft` or :func:`
         cupyx.scipy.fft.irfft`.
      """
      from cupy.cuda import cufft
  
      if n is None:
          n = x.shape[axis]
      m = min(n, x.shape[axis])
  
      shape = list(x.shape)
      shape[axis] = n // 2 + 1
      if x.dtype in (cupy.float16, cupy.float32):
          z = cupy.zeros(shape, dtype=cupy.complex64)
      else:
          z = cupy.zeros(shape, dtype=cupy.complex128)
  
      slice_x = [slice(None)] * x.ndim
      slice_z = [slice(None)] * x.ndim
  
      slice_x[axis] = slice(1)
      slice_z[axis] = slice(1)
      z[tuple(slice_z)].real = x[tuple(slice_x)]
  
      slice_x[axis] = slice(1, m, 2)
      slice_z[axis] = slice(1, m // 2 + 1)
      z[tuple(slice_z)].real = x[tuple(slice_x)]
  
      slice_x[axis] = slice(2, m, 2)
      slice_z[axis] = slice(1, (m + 1) // 2)
      z[tuple(slice_z)].imag = x[tuple(slice_x)]
  
      return _fft(
          z,
          (n,),
          (axis,),
          None,
          cufft.CUFFT_INVERSE,
          "C2R",
          overwrite_x=overwrite_x,
      )
  
file_path: cupy/cupyx/scipy/fftpack/_fft.py
imports: from numpy import prod
  import cupy
  from cupy.fft import config
  from cupy.fft._fft import _convert_fft_type, _default_fft_func, _fft, _get_cufft_plan_nd, _get_fftn_out_size, _output_dtype
  from cupy.fft._cache import get_plan_cache
label_desc: Use image node_id 9 for calling a global function with example usage: irfft(x, n, axis, overwrite_x) and returns: _fft