Skip to content

Commit aacfa26

Browse files
Make keras2onnx tests deterministic (#1608)
Signed-off-by: Tom Wildenhain <[email protected]>
1 parent b65b05e commit aacfa26

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/keras2onnx_unit_tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
@pytest.fixture(scope='function')
1717
def runner():
1818
np.random.seed(42)
19-
if is_tf_keras and is_tf2:
19+
if is_tf2:
2020
tf.random.set_seed(42)
21+
else:
22+
tf.random.set_random_seed(42)
2123
model_files = []
2224

2325
def runner_func(*args, **kwargs):

0 commit comments

Comments
 (0)