Commit 9a99fc8
authored
[Utils] Allow classmethod and staticmethod in TVMDerivedObject (#14249)
Instance methods that exist in the user-defined class but not in the
TVM base are forward using `__getattr__`. However, this is only
applied for attribute look of instances, and doesn't apply for
attribute lookup on the class object itself, such as when calling a
classmethod or staticmethod.
This commit exposes class methods and static methods in the wrapper
class, if they are defined in the user-defined subclass.1 parent 06fabe4 commit 9a99fc8
File tree
2 files changed
+24
-0
lines changed- python/tvm/meta_schedule
- tests/python/unittest
2 files changed
+24
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
131 | 134 | | |
132 | 135 | | |
133 | 136 | | |
| |||
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
407 | 428 | | |
408 | 429 | | |
0 commit comments