def uirfftn(inarray, dim=None, shape=None):
 if (dim is None):
  dim = inarray.ndim
 outarray = np.fft.irfftn(inarray, shape, axes=range((- dim), 0))
 return (outarray * np.sqrt(np.prod(outarray.shape[(- dim):])))

def uirfftn ( inarray , dim = None , shape = None ) : if ( dim is None ) : dim = inarray . ndim outarray = np . fft . irfftn ( inarray , shape , axes = range ( ( - dim ) , 0 ) ) return ( outarray * np . sqrt ( np . prod ( outarray . shape [ ( - dim ) : ] ) ) )
n-dimensional inverse real unitary fourier transform .