Open
Description
I would like to know if it is possible to define a custom operator with a different name that its function name.
Example:
import onnx
# We use ONNX opset 15 to define the function below.
from onnxscript import FLOAT, script
from onnxscript import opset15 as op
@script(op_type="MY_NEW_NAME_OP")
def custom_op(X):
return 5*X
def sample_model(X: FLOAT[64, 128]) -> FLOAT[64, 128]:
return custom_op(X)
# onnx_model is an in-memory ModelProto
onnx_model = sample_model.to_model_proto()
# Check node op_type
assert model.graph.node[0].op_type == "MY_NEW_NAME_OP"