microsoft / onnxscript

ONNX Script enables developers to naturally author ONNX functions and models using a subset of Python.
https://onnxscript.ai/
MIT License
273 stars 53 forks source link

Optional node-input in rewriter pattern #1385

Open gramalingam opened 5 months ago

gramalingam commented 5 months ago

What does it mean when one of the node-inputs is "" (when the pattern is described using a FunctionProto)?

It seems best to treat it as a requirement that the corresponding input in a graph must also be "" for a successful match.

Another scenario is where the user does not care what that corresponding node-input is (for a match). This must be represented by using a new function-parameter.

justinchuby commented 5 months ago

I agree that having a special wildcard construct to mean “don’t care” is clear and preferable. Otherwise it can be implicit and ambiguous