Skip to content

Commit

Permalink
change to tf.Graph
Browse files Browse the repository at this point in the history
Signed-off-by: hwangdeyu <dejack953@outlook.com>
Co-authored-by: Guenther Schmuelling <guschmue@microsoft.com>
Co-authored-by: fatcat-z <jiz@microsoft.com>
  • Loading branch information
3 people committed Jan 20, 2022
1 parent ebd2c10 commit 036a3ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2376,6 +2376,9 @@ def func(x):
return tf.identity(x_, name=_TFOUTPUT)
self._run_test_case(func, [_OUTPUT], {_INPUT: x_val})

@skip_tflite("skip_tflite is not support unit32 when tf version <= 2.3.0")
@check_opset_min_version(6, "cast")
def test_cast_unit32(self):
x_val = np.array([1, 2, 3, 4], dtype=np.uint32).reshape((2, 2))
def func(x):
x_ = tf.cast(x, tf.uint64)
Expand Down
5 changes: 2 additions & 3 deletions tf2onnx/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,8 @@ def _from_keras_tf1(model, input_signature=None, opset=None, custom_ops=None, cu

with tf.device("/cpu:0"):
frozen_graph, initialized_tables = tf_loader.freeze_session(sess, input_names, output_names, get_tables=True)
tf_loader.tf_reset_default_graph()
with tf_loader.tf_session() as sess:
tf.import_graph_def(frozen_graph, name='')
with tf.Graph().as_default():
tf.import_graph_def(frozen_graph, name="")
frozen_graph = tf_loader.tf_optimize(input_names, output_names, frozen_graph, False)
model_proto, external_tensor_storage = _convert_common(
frozen_graph,
Expand Down
1 change: 1 addition & 0 deletions tf2onnx/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: Apache-2.0

version = '1.10.0'
git_version = '219e00c073f6e73fba7335630dcf1f96cc82c983'

0 comments on commit 036a3ce

Please sign in to comment.