You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to know if it is possible to define a custom operator with a different name that its function name.
Example:
importonnx# We use ONNX opset 15 to define the function below.fromonnxscriptimportFLOAT, scriptfromonnxscriptimportopset15asop@script(op_type="MY_NEW_NAME_OP")defcustom_op(X):
return5*Xdefsample_model(X: FLOAT[64, 128]) ->FLOAT[64, 128]:
returncustom_op(X)
# onnx_model is an in-memory ModelProtoonnx_model=sample_model.to_model_proto()
# Check node op_typeassertmodel.graph.node[0].op_type=="MY_NEW_NAME_OP"
The text was updated successfully, but these errors were encountered:
I would like to know if it is possible to define a custom operator with a different name that its function name.
Example:
The text was updated successfully, but these errors were encountered: