Skip to content

Commit 036a3ce

Browse files
hwangdeyuguschmuefatcat-z
committed
change to tf.Graph
Signed-off-by: hwangdeyu <[email protected]> Co-authored-by: Guenther Schmuelling <[email protected]> Co-authored-by: fatcat-z <[email protected]>
1 parent ebd2c10 commit 036a3ce

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

tests/test_backend.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,6 +2376,9 @@ def func(x):
23762376
return tf.identity(x_, name=_TFOUTPUT)
23772377
self._run_test_case(func, [_OUTPUT], {_INPUT: x_val})
23782378

2379+
@skip_tflite("skip_tflite is not support unit32 when tf version <= 2.3.0")
2380+
@check_opset_min_version(6, "cast")
2381+
def test_cast_unit32(self):
23792382
x_val = np.array([1, 2, 3, 4], dtype=np.uint32).reshape((2, 2))
23802383
def func(x):
23812384
x_ = tf.cast(x, tf.uint64)

tf2onnx/convert.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,8 @@ def _from_keras_tf1(model, input_signature=None, opset=None, custom_ops=None, cu
373373

374374
with tf.device("/cpu:0"):
375375
frozen_graph, initialized_tables = tf_loader.freeze_session(sess, input_names, output_names, get_tables=True)
376-
tf_loader.tf_reset_default_graph()
377-
with tf_loader.tf_session() as sess:
378-
tf.import_graph_def(frozen_graph, name='')
376+
with tf.Graph().as_default():
377+
tf.import_graph_def(frozen_graph, name="")
379378
frozen_graph = tf_loader.tf_optimize(input_names, output_names, frozen_graph, False)
380379
model_proto, external_tensor_storage = _convert_common(
381380
frozen_graph,

tf2onnx/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SPDX-License-Identifier: Apache-2.0
12

23
version = '1.10.0'
34
git_version = '219e00c073f6e73fba7335630dcf1f96cc82c983'

0 commit comments

Comments
 (0)