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
Add hasInput method to InferenceContext #4451
Conversation
Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
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.
LGTM, I think it's a great addition.
@daquexian can you please take a look? This requires the approval from someone in operator SIG. Thanks! |
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.
Great improvement! Shall we also apply hasInput
in
- https://github.com/onnx/onnx/blob/main/onnx/defs/tensor/utils.cc#L95-L99
- https://github.com/onnx/onnx/blob/main/onnx/defs/quantization/old.cc#L41
Besides, do you think it is also useful if we can have another common function for ctx.getNumInputs() > x && hasInputShape(ctx, x)
? For example: https://github.com/onnx/onnx/blob/main/onnx/defs/nn/old.cc#L70-L77 It can be done by another PR if needed.
Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
Added the first two, thanks! As for the next suggestion, |
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.
Good improvement!
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.
LGTM :)
* Add hasInput method to InferenceContext Signed-off-by: Ganesan Ramalingam <grama@microsoft.com> * Fix const Signed-off-by: Ganesan Ramalingam <grama@microsoft.com> * Replace other uses Signed-off-by: Ganesan Ramalingam <grama@microsoft.com> Signed-off-by: Ganesan Ramalingam <grama@microsoft.com> Co-authored-by: Ke Zhang <linkerzhang@yeah.net> Co-authored-by: Chun-Wei Chen <jacky82226@gmail.com>
See #4447 for a discussion.