junrushao1994 commented on a change in pull request #10368:
URL: https://github.com/apache/tvm/pull/10368#discussion_r817414207
##########
File path: python/tvm/meta_schedule/utils.py
##########
@@ -31,6 +31,107 @@
from tvm.tir import FloatImm, IntImm
+def derived_object(cls: type) -> type:
+ """A decorator to register derived subclasses for TVM objects.
+
+ Parameters
+ ----------
+ cls : type
+ The derived class to be registered.
+
+ Returns
+ -------
+ cls : type
+ The decorated TVM object.
+
+ Example
+ -------
+ .. code-block:: python
+
+ @register_object("meta_schedule.PyRunner")
+ class _PyRunner(meta_schedule.Runner):
+ def __init__(self, methods: List[Callable]):
+ self.__init_handle_by_constructor__(_ffi_api.RunnerPyRunner,
*methods)
+
+ class PyRunner():
+ _tvm_metadata = {
+ "cls": _PyRunner,
+ "methods": ["run"]
+ }
Review comment:
"members" => "fields"
```suggestion
"cls": _PyRunner,
"fields": [],
"methods": ["run"],
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]