77import tensorflow as tf
88
99from backend_test_base import Tf2OnnxBackendTestBase
10- from common import unittest_main , check_tf_min_version , check_tf_max_version , check_onnxruntime_min_version
10+ from common import unittest_main , check_tf_min_version , check_tf_max_version , \
11+ check_onnxruntime_min_version , check_tfjs_max_version
1112from tf2onnx .tf_loader import is_tf2
1213
1314
@@ -66,6 +67,7 @@ def func(i):
6667 x_val = np .array (3 , dtype = np .int32 )
6768 self .run_test_case (func , {_INPUT : x_val }, [], [_OUTPUT ], rtol = 1e-06 )
6869
70+ @check_tfjs_max_version ("3.15" , "failed when tfjs version > 3.15" )
6971 def test_while_loop_with_ta_write (self ):
7072 def func (i ):
7173 output_ta = tf .TensorArray (dtype = tf .int32 , size = 0 , dynamic_size = True )
@@ -159,6 +161,7 @@ def b(i, res, res2):
159161 output_names_with_port = ["i:0" , "x:0" , "y:0" ]
160162 self .run_test_case (func , feed_dict , input_names_with_port , output_names_with_port , rtol = 1e-06 )
161163
164+ @check_tfjs_max_version ("3.15" , "failed when tfjs version > 3.15" )
162165 def test_while_loop_with_ta_read_and_write (self ):
163166 def func (i , inputs ):
164167 inputs_2 = tf .identity (inputs )
@@ -183,6 +186,7 @@ def b(i, out_ta):
183186 output_names_with_port = ["i:0" , "output_ta:0" ]
184187 self .run_test_case (func , feed_dict , input_names_with_port , output_names_with_port , rtol = 1e-06 )
185188
189+ @check_tfjs_max_version ("3.15" , "failed when tfjs version > 3.15" )
186190 def test_while_loop_with_multi_scan_outputs (self ):
187191 def func (i , inputs1 , inputs2 ):
188192 inputs1_ = tf .identity (inputs1 )
@@ -217,6 +221,7 @@ def b(i, out_ta, out_ta2):
217221 output_names_with_port = ["i:0" , "output_ta:0" , "output_ta2:0" ]
218222 self .run_test_case (func , feed_dict , input_names_with_port , output_names_with_port , rtol = 1e-06 )
219223
224+ @check_tfjs_max_version ("3.15" , "failed when tfjs version > 3.15" )
220225 @check_onnxruntime_min_version (
221226 "0.5.0" ,
222227 "disable this case due to onnxruntime loop issue: https://github.com/microsoft/onnxruntime/issues/1272"
0 commit comments