We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac766dc commit a27b4a6Copy full SHA for a27b4a6
src/qonnx/core/modelwrapper.py
@@ -198,7 +198,11 @@ def get_tensor_datatype(self, tensor_name):
198
# TensorProto.INT64 : "INT64",
199
}
200
tensor_vi = self.get_tensor_valueinfo(tensor_name)
201
- onnx_dtype = tensor_vi.type.tensor_type.elem_type
+ if tensor_vi is None:
202
+ # some initialized tensors don't get ValueInfo even after shape inference
203
+ _, onnx_dtype = self.get_initializer(tensor_name, return_dtype=True)
204
+ else:
205
+ onnx_dtype = tensor_vi.type.tensor_type.elem_type
206
if onnx_dtype in onnx_dtype_to_qonnx_dtype.keys():
207
return DataType[onnx_dtype_to_qonnx_dtype[onnx_dtype]]
208
else:
0 commit comments