def irfft(inp, norm=None, is_odd=False):
 if (is_odd not in (True, False)):
  raise ValueError(('Invalid value %s for id_odd, must be True or False' % is_odd))
 s = inp.shape[1:(-1)]
 if is_odd:
  s = T.set_subtensor(s[(-1)], (((s[(-1)] - 1) * 2) + 1))
 else:
  s = T.set_subtensor(s[(-1)], ((s[(-1)] - 1) * 2))
 cond_norm = _unitary(norm)
 scaling = 1
 if (cond_norm is None):
  scaling = s.prod().astype(inp.dtype)
 elif (cond_norm == 'ortho'):
  scaling = T.sqrt(s.prod().astype(inp.dtype))
 return (irfft_op(inp, s) / scaling)

def irfft ( inp , norm = None , is_odd = False ) : if ( is_odd not in ( True , False ) ) : raise ValueError ( ( 'Invalid value %s for id_odd, must be True or False' % is_odd ) ) s = inp . shape [ 1 : ( - 1 ) ] if is_odd : s = T . set_subtensor ( s [ ( - 1 ) ] , ( ( ( s [ ( - 1 ) ] - 1 ) * 2 ) + 1 ) ) else : s = T . set_subtensor ( s [ ( - 1 ) ] , ( ( s [ ( - 1 ) ] - 1 ) * 2 ) ) cond_norm = _unitary ( norm ) scaling = 1 if ( cond_norm is None ) : scaling = s . prod ( ) . astype ( inp . dtype ) elif ( cond_norm == 'ortho' ) : scaling = T . sqrt ( s . prod ( ) . astype ( inp . dtype ) ) return ( irfft_op ( inp , s ) / scaling )
return inverse discrete fourier transform of real sequence x .