-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[refactor] Cleanup python imports #2226
Conversation
# object within it, is that ti_core is stateful. While in practice ti_core is | ||
# loaded during the import procedure, it's probably still good to delay the | ||
# access to it. | ||
from taichi.core import util as cutil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably do this for all the other aliases of ti_core
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good :-)
|
||
|
||
@unit('task') | ||
def _unit(unit_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean unittest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unit
was a wrapper over the legacy interface/impl-managing system used in legacy Taichi. I think there are still usages of unit
. task
is an example: https://taichi.readthedocs.io/en/stable/contributor_guide.html?highlight=libdevice#upgrading-cuda
The interface/unit system is intended to improve the modularity of the legacy Taichi library. I think we do not need them anymore. Given it seems overdesigned at this point, we may need to at least simplify it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see.
task is an example:
Right. I searched for @unit
and tasks
is the only user, so I moved unit
here (instead of staying at core
)..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Sorry about leaving these messy imports for you. It's clearly a lot of work to clean these up - thank you so much!
|
||
|
||
@unit('task') | ||
def _unit(unit_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unit
was a wrapper over the legacy interface/impl-managing system used in legacy Taichi. I think there are still usages of unit
. task
is an example: https://taichi.readthedocs.io/en/stable/contributor_guide.html?highlight=libdevice#upgrading-cuda
The interface/unit system is intended to improve the modularity of the legacy Taichi library. I think we do not need them anymore. Given it seems overdesigned at this point, we may need to at least simplify it...
# object within it, is that ti_core is stateful. While in practice ti_core is | ||
# loaded during the import procedure, it's probably still good to delay the | ||
# access to it. | ||
from taichi.core import util as cutil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good :-)
Related issue = #2223
[Click here for the format server]