Skip to content

Commit 6a4fc17

Browse files
Fix nightly build for tf2.1 (#1564)
Signed-off-by: Tom Wildenhain <[email protected]>
1 parent de80f51 commit 6a4fc17

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

tests/test_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import tensorflow as tf
1313
from onnx import helper
1414

15-
from common import check_tf_min_version, unittest_main, requires_custom_ops, check_opset_min_version
15+
from common import check_tf_min_version, unittest_main, requires_custom_ops, check_opset_min_version, skip_tf_versions
1616
from tf2onnx.tf_loader import is_tf2
1717
from backend_test_base import Tf2OnnxBackendTestBase
1818
import tf2onnx
@@ -73,12 +73,14 @@ def test_keras_api(self):
7373
self._test_keras_api(large_model=False)
7474

7575
@check_tf_min_version("1.15")
76+
@skip_tf_versions(["2.0", "2.1"], "TF 2 requires 2.2 for large model freezing")
7677
def test_keras_api_large(self):
7778
self._test_keras_api(large_model=True)
7879

7980
@requires_custom_ops()
8081
@check_tf_min_version("1.15")
8182
@check_opset_min_version(11, "SparseToDense")
83+
@skip_tf_versions(["2.1"], "TF 2.1 keras model doesn't work; table not initialized")
8284
def test_keras_hashtable(self):
8385

8486
feature_cols = [

tests/test_backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4646,7 +4646,7 @@ def func(starts, limits, deltas):
46464646
self._run_test_case(func, [_OUTPUT, _OUTPUT1], {_INPUT: starts_val, _INPUT1: limits_val,
46474647
_INPUT2: deltas_val})
46484648

4649-
@check_tf_min_version("2.0", "ragged variant needs tf 2.0")
4649+
@check_tf_min_version("2.2", "ragged variant needs tf 2.2")
46504650
@check_opset_min_version(13, "Loop over tensor sequences")
46514651
def test_ragged_to_variant(self):
46524652
splits_val = np.array([0, 3, 3, 5, 9, 10], dtype=np.int32)
@@ -4662,7 +4662,7 @@ def func(splits, rt_dense_values):
46624662
return tf.identity(y.row_splits, name=_TFOUTPUT), tf.identity(y.flat_values, name=_TFOUTPUT1)
46634663
self._run_test_case(func, [_OUTPUT, _OUTPUT1], {_INPUT: splits_val, _INPUT1: dense_vals_val})
46644664

4665-
@check_tf_min_version("2.0", "ragged variant needs tf 2.0")
4665+
@check_tf_min_version("2.2", "ragged variant needs tf 2.2")
46664666
@check_opset_min_version(13, "Loop over tensor sequences")
46674667
def test_ragged_to_variant_unknown_shape(self):
46684668
splits_val = np.array([0, 3, 3, 5, 9, 10], dtype=np.int64)

tests/test_string_ops.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def func(x1, x2):
111111
self._run_test_case(func, [_OUTPUT], {_INPUT: x_val1, _INPUT1: x_val2})
112112

113113
@requires_custom_ops("RegexSplitWithOffsets")
114-
@check_tf_min_version("2.0", "tensorflow_text")
114+
@check_tf_min_version("2.3", "tensorflow_text")
115115
def test_regex_split_with_offsets(self):
116116
from tensorflow_text.python.ops.regex_split_ops import (
117117
gen_regex_split_ops as lib_gen_regex_split_ops)
@@ -134,7 +134,7 @@ def _run_test_case(self, func, output_names_with_port, feed_dict, **kwargs):
134134
use_custom_ops=True, process_args=process_args, **kwargs)
135135

136136
@requires_custom_ops("WordpieceTokenizer")
137-
@check_tf_min_version("2.0", "tensorflow_text")
137+
@check_tf_min_version("2.3", "tensorflow_text")
138138
@unittest.skip("Not fixed yet")
139139
def test_wordpiece_tokenizer(self):
140140
from tensorflow_text.python.ops.wordpiece_tokenizer import (

0 commit comments

Comments
 (0)