Implemented Torch Version of Key Functions#6
Open
crhea93 wants to merge 4 commits intodokkum:mainfrom
Open
Conversation
Owner
|
Ha great!
…On Tue, Sep 16, 2025 at 9:48 AM Carter Lee Rhea ***@***.***> wrote:
I've added two functions that torchize (torchify?) the computation of
indices with nans and processing masked pixels.
I've also made it so that a user can elect to use the torch versions by
setting the torch argument to True.
Finally, if a user tries to run the torch version but doesn't have torch
installed, the code will revert to the numpy version.
When I ran the original M51 test using the numpy version, it took 2
seconds on my machine. When I ran the same test using the torch version on
a CPU, it took 0.7 seconds to run. The results were identical, as expected.
------------------------------
You can view, comment on, or merge this pull request online at:
#6
Commit Summary
- a49d707
<a49d707>
Include option for torch
- d9de713
<d9de713>
remove fits files in docs
- 60dd117
<60dd117>
Added fallback to numpy
File Changes
(5 files <https://github.com/dokkum/maskfill/pull/6/files>)
- *M* .gitignore
<https://github.com/dokkum/maskfill/pull/6/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947>
(1)
- *M* docs/python-usage.ipynb
<https://github.com/dokkum/maskfill/pull/6/files#diff-339363154f14ba16c8dd21c01fd0b28bca5b978aa618b0021585245d2b1ed849>
(54)
- *M* maskfill/maskfill.py
<https://github.com/dokkum/maskfill/pull/6/files#diff-ece895265e4445ac2d7aebf454348de0917073b34188d64b9c336e7741488252>
(172)
- *M* tests/test_maskfill.py
<https://github.com/dokkum/maskfill/pull/6/files#diff-8006e2d9e31a8238779524e16672278c160e3fec143b1533b30f31a3081013f0>
(2)
- *A* tests/test_torch.py
<https://github.com/dokkum/maskfill/pull/6/files#diff-9008d0218658d9a9017bb70592e6457a0056ecc7372942a23d6a90ae8c05e311>
(187)
Patch Links:
- https://github.com/dokkum/maskfill/pull/6.patch
- https://github.com/dokkum/maskfill/pull/6.diff
—
Reply to this email directly, view it on GitHub
<#6>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHGCWS7P57KSEP5R5MAE3RL3TAIKNAVCNFSM6AAAAACGU42ZVSVHI2DSMVQWIX3LMV43ASLTON2WKOZTGQZDEMZYHEZTQMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I've added two functions that torchize (torchify?) the computation of indices with nans and processing masked pixels.
I've also made it so that a user can elect to use the torch versions by setting the
torchargument toTrue.Finally, if a user tries to run the torch version but doesn't have torch installed, the code will revert to the numpy version.
When I ran the original M51 test using the numpy version, it took 2 seconds on my machine. When I ran the same test using the torch version on a CPU, it took 0.7 seconds to run. The results were identical, as expected.