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
00064117
Commit
00064117
authored
Jul 21, 2025
by
Thorsten Kurth
Browse files
small device fix
parent
4aaff021
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
torch_harmonics/csrc/disco/disco_helpers.cpp
torch_harmonics/csrc/disco/disco_helpers.cpp
+0
-1
torch_harmonics/legendre.py
torch_harmonics/legendre.py
+3
-3
No files found.
torch_harmonics/csrc/disco/disco_helpers.cpp
View file @
00064117
...
@@ -110,7 +110,6 @@ torch::Tensor preprocess_psi(const int64_t K, const int64_t Ho, torch::Tensor ke
...
@@ -110,7 +110,6 @@ torch::Tensor preprocess_psi(const int64_t K, const int64_t Ho, torch::Tensor ke
int64_t
*
col_h
=
col_idx
.
data_ptr
<
int64_t
>
();
int64_t
*
col_h
=
col_idx
.
data_ptr
<
int64_t
>
();
int64_t
*
roff_h
=
new
int64_t
[
Ho
*
K
+
1
];
int64_t
*
roff_h
=
new
int64_t
[
Ho
*
K
+
1
];
int64_t
nrows
;
int64_t
nrows
;
// float *val_h = val.data_ptr<float>();
AT_DISPATCH_FLOATING_TYPES
(
val
.
scalar_type
(),
"preprocess_psi"
,
([
&
]
{
AT_DISPATCH_FLOATING_TYPES
(
val
.
scalar_type
(),
"preprocess_psi"
,
([
&
]
{
preprocess_psi_kernel
<
scalar_t
>
(
nnz
,
K
,
Ho
,
ker_h
,
row_h
,
col_h
,
roff_h
,
preprocess_psi_kernel
<
scalar_t
>
(
nnz
,
K
,
Ho
,
ker_h
,
row_h
,
col_h
,
roff_h
,
...
...
torch_harmonics/legendre.py
View file @
00064117
...
@@ -57,10 +57,10 @@ def legpoly(mmax: int, lmax: int, x: torch.Tensor, norm: Optional[str]="ortho",
...
@@ -57,10 +57,10 @@ def legpoly(mmax: int, lmax: int, x: torch.Tensor, norm: Optional[str]="ortho",
# compute the tensor P^m_n:
# compute the tensor P^m_n:
nmax
=
max
(
mmax
,
lmax
)
nmax
=
max
(
mmax
,
lmax
)
vdm
=
torch
.
zeros
((
nmax
,
nmax
,
len
(
x
)),
dtype
=
torch
.
float64
,
requires_grad
=
False
)
vdm
=
torch
.
zeros
((
nmax
,
nmax
,
len
(
x
)),
dtype
=
torch
.
float64
,
device
=
x
.
device
,
requires_grad
=
False
)
norm_factor
=
1.
if
norm
==
"ortho"
else
math
.
sqrt
(
4
*
math
.
pi
)
norm_factor
=
1.
0
if
norm
==
"ortho"
else
math
.
sqrt
(
4
*
math
.
pi
)
norm_factor
=
1.
/
norm_factor
if
inverse
else
norm_factor
norm_factor
=
1.
0
/
norm_factor
if
inverse
else
norm_factor
# initial values to start the recursion
# initial values to start the recursion
vdm
[
0
,
0
,:]
=
norm_factor
/
math
.
sqrt
(
4
*
math
.
pi
)
vdm
[
0
,
0
,:]
=
norm_factor
/
math
.
sqrt
(
4
*
math
.
pi
)
...
...
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