-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Feature request] Make OpSchema writable from Python #5019
Comments
I think this is a really interesting proposal towards recognising custom operators. Spox currently uses ONNX OpSchemas to generate opset modules, and as such custom operator libraries could register more and we could use Spox utilities directly to generate opset modules. |
I think that’s a great idea |
We will create a single constructor and allow only shape inference overrides instead |
Documentation: FormalParameter |
### Description - Add a python interface to register the OpSchema. - Add a python interface to deregister the OpSchema. - Avoid the value error when executing `OpSchema::Finalize` multiple times - Add flag to enable check node for custom domain - overload `onnx.defs.has` with version parameter example for register OpSchema: ``` op_schema = defs.OpSchema( "CustomOp", "", 1, ) onnx.defs.register_schema(op_schema) ``` example for deregister OpSchema: ``` onnx.defs.deregister_schema('CustomOp', 1) ``` ### Motivation and Context Follow up of #5019 --------- Signed-off-by: oPluss <opluss@qq.com> Signed-off-by: opluss <opluss@qq.com> Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com> Co-authored-by: G. Ramalingam <grama@microsoft.com>
What is the problem that this feature solves?
Not being able to auto create OpSchema for functions in Python; not being able to do shape inference for custom ops.
Alternatives considered
Create a Python class that mirrors OpSchema. We can do that and expose a similar interface, but for onnx shape inference to work, we need to be able to create an OpSchema, register it and write shape inference functions in Python.
Describe the feature
Extend the OpSchema to be writable, and support registering this schema with ONNX.
OpSchema
s to be initialized in Python #5020Will this influence the current api (Y/N)?
Y. It will be an extension of the current OpSchema api.
Feature Area
API
Are you willing to contribute it (Y/N)
Yes
Notes
assigned to @justinchuby
The text was updated successfully, but these errors were encountered: