7
7
import tensorflow as tf
8
8
9
9
from 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
11
12
from tf2onnx .tf_loader import is_tf2
12
13
13
14
@@ -66,6 +67,7 @@ def func(i):
66
67
x_val = np .array (3 , dtype = np .int32 )
67
68
self .run_test_case (func , {_INPUT : x_val }, [], [_OUTPUT ], rtol = 1e-06 )
68
69
70
+ @check_tfjs_max_version ("3.15" , "failed when tfjs version > 3.15" )
69
71
def test_while_loop_with_ta_write (self ):
70
72
def func (i ):
71
73
output_ta = tf .TensorArray (dtype = tf .int32 , size = 0 , dynamic_size = True )
@@ -159,6 +161,7 @@ def b(i, res, res2):
159
161
output_names_with_port = ["i:0" , "x:0" , "y:0" ]
160
162
self .run_test_case (func , feed_dict , input_names_with_port , output_names_with_port , rtol = 1e-06 )
161
163
164
+ @check_tfjs_max_version ("3.15" , "failed when tfjs version > 3.15" )
162
165
def test_while_loop_with_ta_read_and_write (self ):
163
166
def func (i , inputs ):
164
167
inputs_2 = tf .identity (inputs )
@@ -183,6 +186,7 @@ def b(i, out_ta):
183
186
output_names_with_port = ["i:0" , "output_ta:0" ]
184
187
self .run_test_case (func , feed_dict , input_names_with_port , output_names_with_port , rtol = 1e-06 )
185
188
189
+ @check_tfjs_max_version ("3.15" , "failed when tfjs version > 3.15" )
186
190
def test_while_loop_with_multi_scan_outputs (self ):
187
191
def func (i , inputs1 , inputs2 ):
188
192
inputs1_ = tf .identity (inputs1 )
@@ -217,6 +221,7 @@ def b(i, out_ta, out_ta2):
217
221
output_names_with_port = ["i:0" , "output_ta:0" , "output_ta2:0" ]
218
222
self .run_test_case (func , feed_dict , input_names_with_port , output_names_with_port , rtol = 1e-06 )
219
223
224
+ @check_tfjs_max_version ("3.15" , "failed when tfjs version > 3.15" )
220
225
@check_onnxruntime_min_version (
221
226
"0.5.0" ,
222
227
"disable this case due to onnxruntime loop issue: https://github.com/microsoft/onnxruntime/issues/1272"
0 commit comments