Skip to content

Implemented Torch Version of Key Functions#6

Open
crhea93 wants to merge 4 commits intodokkum:mainfrom
crhea93:main
Open

Implemented Torch Version of Key Functions#6
crhea93 wants to merge 4 commits intodokkum:mainfrom
crhea93:main

Conversation

@crhea93
Copy link

@crhea93 crhea93 commented Sep 16, 2025

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.

@dokkum
Copy link
Owner

dokkum commented Oct 17, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants