New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement per-channel for quantizelinear and dequantizelinear #4759
Conversation
4936b47
to
7561a50
Compare
60e3e03
to
ca8b718
Compare
57c19b9
to
31394c3
Compare
bcdd2f4
to
0066c24
Compare
@@ -47,17 +63,9 @@ Status DequantizeLinear<T>::Compute(OpKernelContext* ctx) const { | |||
ORT_ENFORCE(x_scale.Shape().NumDimensions() == 1 && x_scale.Shape().Size() == broadcast_dim, | |||
"x_scale must be 1D tensor with size ", | |||
broadcast_dim); | |||
ORT_ENFORCE(x_zero_point != nullptr && x_zero_point->Shape().NumDimensions() == 1 && x_zero_point->Shape().Size() == broadcast_dim, | |||
"x_zero_point must be 1D tensor with size ", | |||
ORT_ENFORCE(x_zero_point == nullptr || (x_zero_point->Shape().NumDimensions() == 1 && x_zero_point->Shape().Size() == broadcast_dim), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this just be x_zero_point->Shape()[0] == broadcast_dim?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would apply to the other cases where Shape().Size() is calculated too. Mostly caring about code size here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x_zero_point->Shape()[0] may be out of range even if x_zero_point is not null
0066c24
to
32f32e0
Compare
32f32e0
to
6cdd255
Compare
Looks good to me... there is just 1 thing I am trying to understand - How will onnx testing will be handled in CI. Earlier the suggestion was to update install_onnx.sh file with the latest onnx commit but this file does not exist anymore so wondering how this will be handled. @snnn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The operator changes look good. As discussed offline, I can't tell if bumping up the ONNX commit hash needs any other changes to occur too.
Description: Describe your changes.