I wonder if it is possible to register a custom Op of ONNX from tvm. For 
example, I have a model like:

```py
def create_custom_model():
    op_name = "my_custom_op"
    shape = [32, 32]
    node = helper.make_node(op_name, ["x"], ["y"])
    graph = helper.make_graph([node], "custom_op_graph", inputs=[
        helper.make_tensor_value_info("x", TensorProto.FLOAT, shape)
    ], outputs=[
        helper.make_tensor_value_info("y", TensorProto.FLOAT, shape)
    ])
    
    model = helper.make_model(graph, producer_name="custom_op_model")
    return model
```

It has a new operator called `my_custom_op`, so when I use 
`relax.frontend.onnx.from_onnx` to import this model, it won't work.

```py
if __name__ == '__main__':
    model = create_custom_model()

    # try load it use tvm, it should fail
    ir_mod = from_onnx(model, keep_params_in_input=True)
    ir_mod, params = relax.frontend.detach_params(ir_mod)
    
    ir_mod.show()
```

The error is like:

```txt
UserWarning: No Op registered for my_custom_op with domain_version of 18
```

How could I register this op to TVM? Is there any docs about it? Any help will 
be appreciate. Thanks advance!





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/unity-relax-onnx-frontend-how-could-i-register-a-custom-operator-of-onnx/15242/1)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/25d2965ea33bae3dbe518d7b4390182e30895bbddf0c75f674dfd924d5bf6c1d).

Reply via email to