Skip to content

Commit

Permalink
fix convert_common version retrival (microsoft#6382)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyems authored Jan 19, 2021
1 parent baac7c9 commit ac36596
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions onnxruntime/python/tools/transformers/onnx_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,9 @@ def convert_model_float32_to_float16(self, cast_input_output=True):
""" Convert a graph to FLOAT16
"""
from packaging.version import Version
import onnxconverter_common.float16 as oc
import onnxconverter_common as oc
if Version(oc.__version__) > Version("1.7.0"):
self.model = oc.convert_float_to_float16(self.model, keep_io_types=cast_input_output)
self.model = oc.float16.convert_float_to_float16(self.model, keep_io_types=cast_input_output)
return

graph = self.model.graph
Expand Down

0 comments on commit ac36596

Please sign in to comment.