-
Notifications
You must be signed in to change notification settings - Fork 265
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
Keep ___init__.py
empty? (Codebase merge issue 1 of 3)
#1
Comments
We don't expect both frameworks to be installed. Should probably do conditional imports to import only what's available. I put the import in init to simplify importing and calling the functions. The user shouldn't need to specifically import PyTorch or TF specific modules. I would keep the imports in init but update the other modules to not throw an error if a framework they don't need is not available. |
I'm personally a big fan of the following notation: from ww import builder_tf It doesn't require that you explicitly import anything in
It also doesn't introduce the problem of having to deal with conditional imports. It also doesn't make the code blow-up just by importing the package. Of course, no matter what, if the relevant DL framework is not installed, you will get into trouble when importing the ww TF or PyTorch builder. |
Hey @waleedka,
Please see:
https://github.com/waleedka/weightwatcher/blob/aa8f1546f27401b61296d96be8095e290318f8b3/ww/__init__.py#L2-L18
The text was updated successfully, but these errors were encountered: