You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/09/13 11:54:43 UTC
[GitHub] [tvm] loveppdog opened a new issue, #12767: [Bug] How to register op by c++.
loveppdog opened a new issue, #12767:
URL: https://github.com/apache/tvm/issues/12767
I want to register support op by c++ to implement the following func like python code.
@tvm.ir.register_op_attr("nn.avg_pool2d","dnnl")
def avg_pool2d_check(expr):
attrs, args = expr.attrs, expr.args
data_typ = args[0].checked_type
rank = len(data_typ.shape)
if rank < 3 or rank > 4 or data_typ.dtype != "float32":
return False
if attrs.layout != "NCHW":
return False
return true
But I can't get expr in C++ by using PackedFunc (TVMArgs args, TVMRetValue* rv).
How to get expr from TVMArgs ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] vinx13 closed issue #12767: [Bug] How to register op by c++.
Posted by GitBox <gi...@apache.org>.
vinx13 closed issue #12767: [Bug] How to register op by c++.
URL: https://github.com/apache/tvm/issues/12767
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] vinx13 commented on issue #12767: [Bug] How to register op by c++.
Posted by GitBox <gi...@apache.org>.
vinx13 commented on issue #12767:
URL: https://github.com/apache/tvm/issues/12767#issuecomment-1245812224
You can register typed packed func using `set_body_typed` so that you don't have to accept `TVMArgs`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org