Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
remove
from baseutils import *
#1421remove
from baseutils import *
#1421Changes from all commits
4481e36
e76dba4
8ce4796
ed98222
ba33c81
b987ee8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
It's OK to replace uses of
baseutils
with explicitbaseutils.foo
calls in this file, but conceptuallybaseutils
,codeutils
andutils
offer a progressive expansion of utility functions. Most files can just importutils
(and doing so gives them all the functions incodeutils
andbaseutils
), but some files can only importcodeutils
orbaseutils
.baseutils
depends only on Python and PyTorch.codeutils
depends on thunder'sdtypes
,devices
andpytree
submodules.utils
also depends onprims
,trace
andproxies
.For files that cannot import
utils
but can importcodeutils
, they probably wantbaseutils
, too, just like how importingutils
provides access to the functions inbaseutils
andcodeutils
.There are some files, like
trace.py
, that import bothcodeutils
andbaseutils
, but they could just importcodeutils
, instead.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.
Let's not aim to minimize the number of import lines but maximize that there is one standard way to access a given function and only deviate from it when there is a need to. I don't mind if we use baseutils.foo or utils.foo by default but let's not do a thing codeutils.foo if you import codeutils and otherwise baseutils.foo .