Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-harmonics
Commits
f30ec30a
Commit
f30ec30a
authored
Jul 21, 2025
by
Thorsten Kurth
Browse files
adding more missing device statements
parent
ea8d1a2e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
torch_harmonics/convolution.py
torch_harmonics/convolution.py
+3
-3
torch_harmonics/legendre.py
torch_harmonics/legendre.py
+1
-1
No files found.
torch_harmonics/convolution.py
View file @
f30ec30a
...
@@ -92,8 +92,8 @@ def _normalize_convolution_tensor_s2(
...
@@ -92,8 +92,8 @@ def _normalize_convolution_tensor_s2(
q
=
quad_weights
[
ilat_in
].
reshape
(
-
1
)
q
=
quad_weights
[
ilat_in
].
reshape
(
-
1
)
# buffer to store intermediate values
# buffer to store intermediate values
vnorm
=
torch
.
zeros
(
kernel_size
,
nlat_out
)
vnorm
=
torch
.
zeros
(
kernel_size
,
nlat_out
,
device
=
psi_vals
.
device
)
support
=
torch
.
zeros
(
kernel_size
,
nlat_out
)
support
=
torch
.
zeros
(
kernel_size
,
nlat_out
,
device
=
psi_vals
.
device
)
# loop through dimensions to compute the norms
# loop through dimensions to compute the norms
for
ik
in
range
(
kernel_size
):
for
ik
in
range
(
kernel_size
):
...
@@ -207,7 +207,7 @@ def _precompute_convolution_tensor_s2(
...
@@ -207,7 +207,7 @@ def _precompute_convolution_tensor_s2(
sgamma
=
torch
.
sin
(
gamma
)
sgamma
=
torch
.
sin
(
gamma
)
# compute row offsets
# compute row offsets
out_roff
=
torch
.
zeros
(
nlat_out
+
1
,
dtype
=
torch
.
int64
)
out_roff
=
torch
.
zeros
(
nlat_out
+
1
,
dtype
=
torch
.
int64
,
device
=
lons_in
.
device
)
out_roff
[
0
]
=
0
out_roff
[
0
]
=
0
for
t
in
range
(
nlat_out
):
for
t
in
range
(
nlat_out
):
# the last angle has a negative sign as it is a passive rotation, which rotates the filter around the y-axis
# the last angle has a negative sign as it is a passive rotation, which rotates the filter around the y-axis
...
...
torch_harmonics/legendre.py
View file @
f30ec30a
...
@@ -123,7 +123,7 @@ def _precompute_dlegpoly(mmax: int, lmax: int, t: torch.Tensor,
...
@@ -123,7 +123,7 @@ def _precompute_dlegpoly(mmax: int, lmax: int, t: torch.Tensor,
pct
=
_precompute_legpoly
(
mmax
+
1
,
lmax
+
1
,
t
,
norm
=
norm
,
inverse
=
inverse
,
csphase
=
False
)
pct
=
_precompute_legpoly
(
mmax
+
1
,
lmax
+
1
,
t
,
norm
=
norm
,
inverse
=
inverse
,
csphase
=
False
)
dpct
=
torch
.
zeros
((
2
,
mmax
,
lmax
,
len
(
t
)),
dtype
=
torch
.
float64
,
requires_grad
=
False
)
dpct
=
torch
.
zeros
((
2
,
mmax
,
lmax
,
len
(
t
)),
dtype
=
torch
.
float64
,
device
=
t
.
device
,
requires_grad
=
False
)
# fill the derivative terms wrt theta
# fill the derivative terms wrt theta
for
l
in
range
(
0
,
lmax
):
for
l
in
range
(
0
,
lmax
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment