File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 18
18
import tensorflow as tf
19
19
20
20
from tensorflow .python .ops import lookup_ops
21
+ try :
22
+ from tensorflow import signal as tf_signal
23
+ except ImportError :
24
+ tf_signal = None
21
25
from backend_test_base import Tf2OnnxBackendTestBase
22
26
# pylint reports unused-wildcard-import which is false positive, __all__ is defined in common
23
27
from common import * # pylint: disable=wildcard-import,unused-wildcard-import
@@ -3625,6 +3629,7 @@ def test_conv2d_1_kernel_as_input(self):
3625
3629
[1. , 1. , 4. ]], dtype = np .float32 ).reshape (_KERNEL3x3 )
3626
3630
self ._conv_kernel_as_input_test (x_val , w_val )
3627
3631
3632
+ @unittest .skipIf (tf_signal is None , reason = "TF does not have submodule signal." )
3628
3633
def test_rfft_ops (self ):
3629
3634
3630
3635
def DFT_slow (x , M ):
@@ -3641,7 +3646,7 @@ def DFT_slow(x, M):
3641
3646
3642
3647
x_val = make_xval ([3 , 4 ]).astype (np .float32 )
3643
3648
def func (x ):
3644
- op_ = tf . signal .rfft (x )
3649
+ op_ = tf_signal .rfft (x )
3645
3650
return tf .abs (op_ , name = _TFOUTPUT )
3646
3651
self ._run_test_case (func , [_OUTPUT ], {_INPUT : x_val })
3647
3652
You can’t perform that action at this time.
0 commit comments