如何在 tensorflow 2.0.0 中导入 fft2d?

How do I import the fft2d in tensorflow 2.0.0?

我想使用fft2d function of tensorflow 2.0.0。 在 1.14.0 中,我可以执行以下操作:

from tensorflow.signal import fft2d

在 2.0.0 中,我得到以下错误:ModuleNotFoundError: No module named 'tensorflow.signal'

但是我可以这样做:

import tensorflow as tf
tf.signal.fft2d

不过,我觉得有点重,我想直接用fft2d。为什么我不能再使用以前的方法了?

在 Tensorflow 2.0 中导入信号可以通过下面给出的方式完成。

from tensorflow.python.ops.signal.fft_ops import fft2d, ifft2d

更多信息请参考以下内容link and also the following gist

closing this issue已经解决了