Skip to content

Conversation

@Lunderberg
Copy link
Contributor

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.

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.
@tvm-bot
Copy link
Collaborator

tvm-bot commented Mar 9, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

  • No users to tag found in teams: utils See #10317 for details

Generated by tvm-bot

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for enhancing the utility!

@junrushao junrushao merged commit 9a99fc8 into apache:main Mar 13, 2023
@Lunderberg Lunderberg deleted the derived_classmethod_staticmethod branch March 13, 2023 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants