def complex_mod_of_real(x): xshp = x.get_shape().as_list() assert xshp[1] % 2 == 0 xcplx = tf.complex(x[:, 0:xshp[1]/2], x[:, xshp[1]/2:]) return tf.complex_abs(xcplx)