-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
bugcontributions welcomemodule: shape inferenceIssues related to shape inferenceIssues related to shape inference
Description
Bug Report
The document description of DequantizeLinear v19 is:
| y (heterogeneous) - T2: N-D full precision output tensor. It has same shape as input ‘x’.
| T2 in ( tensor(bfloat16), tensor(float), tensor(float16) ): ‘x_scale’ determines the output type.
So the dtype of y
should be the same as x_scale
. However in the code it's fixed to FLOAT
:
.TypeAndShapeInferenceFunction([](ONNX_NAMESPACE::InferenceContext& ctx) {
auto y_type = ctx.getOutputType(0);
// only float is supported
y_type->mutable_tensor_type()->set_elem_type(ONNX_NAMESPACE::TensorProto::FLOAT);
if (!hasInputShape(ctx, 0))
return;
auto& input_shape = getInputShape(ctx, 0);
updateOutputShape(ctx, 0, input_shape);
}));
So if x_scale
dtype is float16
, onnx.shape_inference.infer_shapes
will deduce a wrong output data type.
Metadata
Metadata
Assignees
Labels
bugcontributions welcomemodule: shape inferenceIssues related to shape inferenceIssues related to shape inference