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

Tkurth/torchification #66

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Tkurth/torchification #66

wants to merge 13 commits into from

Conversation

azrael417
Copy link
Collaborator

This PR adds the following features:

  • replacing most numpy pre-computations with torch pre-computations
  • adding python function caching for the pre-computations

@azrael417 azrael417 requested a review from bonevbs January 22, 2025 09:18
@azrael417 azrael417 self-assigned this Jan 22, 2025
]
)
def test_distributed_resampling(
self, nlat_in, nlon_in, nlat_out, nlon_out, batch_size, num_chan, grid_in, grid_out, mode, tol
self, nlat_in, nlon_in, nlat_out, nlon_out, batch_size, num_chan, grid_in, grid_out, mode, tol, verbose
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the verbose option exist in all tests now? Would be good to have it for consistency

@@ -34,6 +34,7 @@
import torch.nn as nn
import torch_harmonics as harmonics

import math
import numpy as np
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to remove the numpy import here? Ideally we should get rid of numpy for everything that gets imported with torch-harmonics

Copy link
Collaborator

@bonevbs bonevbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks already very good to me. Most comments are minor things. I would suggest adding some form of tests for the cache and the modified routines for the grid/quadrature precomputations to make sure they work as intended.

Please also update pyprojerct.toml and Changelog.md

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