junrushao1994 edited a comment on pull request #7108:
URL: https://github.com/apache/tvm/pull/7108#issuecomment-744728049
In file `runtime/registry.h`, Right now the macro is:
```C++
#define TVM_REGISTER_GLOBAL(OpName) \
TVM_STR_CONCAT(TVM_FUNC_REG_VAR_DEF, __COUNTER__) =
::tvm::runtime::Registry::Register(OpName)
```
I think we can change the `runtime::Registry::set_body` method, adding
`f.name_ = this->name_` to it.
The workflow:
* Step 1. c++ closure => tvm packed func. The name of the packed func is
temporarily `<anonymous>`
* Step 2. `TVM_REGISTER_GLOBAL(...).set_body(packed_func)` is invoked
* Step 3. By adding `f.name_ = this->name_` into `set_body`, we change the
packed function's name to the `OpName` used in `TVM_REGISTER_GLOBAL(OpName)`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]