Skip to content
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

API: batch import or user import? #3

Open
balbasty opened this issue Jun 9, 2020 · 1 comment
Open

API: batch import or user import? #3

balbasty opened this issue Jun 9, 2020 · 1 comment
Labels
api API-related issues

Comments

@balbasty
Copy link
Owner

balbasty commented Jun 9, 2020

  • 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).

What should we do @brudfors?

@balbasty balbasty added the api API-related issues label Jun 9, 2020
@brudfors
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api API-related issues
Projects
None yet
Development

No branches or pull requests

2 participants