You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
torch import all submodules when performing import nitorch. That is, we then have access to, e.g., nitorch.nn without having to import it. This is because __init__.py exposes (=imports) all submodules.
Conversely, in scikit-learn, each submodule must be specifically imported by the user, e.g., import sklearn.ensemble.
The first one is more 'ease-of-use' oriented, while the second one is more 'performance-oriented' (as imports actually 'cost' something).
Personally, I prefer (if I understood the question correctly), e.g.:
from nitorch.utils import softmax
I like the look of it and that you have access to the function without having to call its namespace. If that is also better from a performance point of view, then maybe that settles it?
torch
import all submodules when performingimport nitorch
. That is, we then have access to, e.g.,nitorch.nn
without having to import it. This is because__init__.py
exposes (=imports) all submodules.scikit-learn
, each submodule must be specifically imported by the user, e.g.,import sklearn.ensemble
.The first one is more 'ease-of-use' oriented, while the second one is more 'performance-oriented' (as imports actually 'cost' something).
What should we do @brudfors?
The text was updated successfully, but these errors were encountered: