File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11from numbers import Number
22
33import numpy as np
4- from onnx import mapping
4+ from onnx import helper
55from onnx import TensorProto
66import tensorflow as tf
77
@@ -33,8 +33,8 @@ def tf2onnx(dtype):
3333
3434 onnx_dtype = None
3535 try :
36- onnx_dtype = mapping . NP_TYPE_TO_TENSOR_TYPE [ np .dtype (
37- tf_dype .as_numpy_dtype )]
36+ onnx_dtype = helper . np_dtype_to_tensor_dtype ( np .dtype (
37+ tf_dype .as_numpy_dtype ))
3838 finally :
3939 if onnx_dtype is None :
4040 common .logger .warning (
Original file line number Diff line number Diff line change 44from onnx_tf .handlers .backend_handler import BackendHandler
55from onnx_tf .handlers .handler import onnx_op
66from onnx_tf .common import data_type
7- from onnx import mapping
7+ from onnx import helper
88
99
1010@onnx_op ("SequenceEmpty" )
1111class SequenceEmpty (BackendHandler ):
1212
1313 @classmethod
1414 def version_11 (cls , node , ** kwargs ):
15- default_dtype = mapping . NP_TYPE_TO_TENSOR_TYPE [ np .dtype ('float32' )]
15+ default_dtype = helper . np_dtype_to_tensor_dtype ( np .dtype ('float32' ))
1616 dtype = data_type .onnx2tf (node .attrs .get ("dtype" , default_dtype ))
1717
1818 ragged = tf .RaggedTensor .from_row_lengths (values = [], row_lengths = [])
You can’t perform that action at this time.
0 commit comments