-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Removing numpy requirement from all files in examples/pytorch/domain_templates #19947
Conversation
Hi, I will be contributing and changing all of the files in the domain_templates folder. |
examples/pytorch/domain_templates/generative_adversarial_net.py
Outdated
Show resolved
Hide resolved
examples/pytorch/domain_templates/generative_adversarial_net.py
Outdated
Show resolved
Hide resolved
for more information, see https://pre-commit.ci
Hi @awaelchli, I was looking at this line as it has numpy dependency. I tried to look for a torch alternative for this but there aren't any direct functions but some workarounds possible. Should I try to change it with that or are there any other libraries supporting this function? |
The equivalent function from the Python random.sample(range(len(self.buffer)), batch_size) Generally speaking, for examples it's fine to use additional dependencies. If you can't replace the numpy requirement somewhere, that's fine. The original issue #16649 is more concerned with removing the dependency from the package. |
for more information, see https://pre-commit.ci
Once this gets completed, I will try to change |
Alright. I will connect with him in the main issue. Thanks |
What does this PR do?
Part of #16649
Before submitting
PR review
Anyone in the community is welcome to review the PR.
@Borda @carmocca @awaelchli
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Reviewer checklist
📚 Documentation preview 📚: https://pytorch-lightning--19947.org.readthedocs.build/en/19947/