Skip to content

Commit 7ce4754

Browse files
committed
Fix torchscipt error
1 parent c157c23 commit 7ce4754

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

python/featomic/featomic/clebsch_gordan/_dispatch.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def permute(array, axes: List[int]):
7676
raise TypeError(UNKNOWN_ARRAY_TYPE)
7777

7878

79-
def tensordot(array_1, array_2, axes: Union[int, List[int]]):
79+
def tensordot(array_1, array_2, axes: List[List[int]]):
8080
"""
8181
Compute tensor dot product along specified axes for arrays.
8282

python/featomic/featomic/clebsch_gordan/_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ def _compute_labels_full_cartesian_product(
365365
# Check for no shared labels dimensions
366366
for name in labels_1.names:
367367
assert name not in labels_2.names, (
368-
"`labels_1` and `labels_2` must not have a" " dimension ({name}) in common"
368+
"`labels_1` and `labels_2` must not have a dimension ({name}) in common"
369369
)
370370
# Create the new labels names by concatenating the names of the two input labels
371371
labels_names: List[str] = labels_1.names + labels_2.names

python/featomic/tests/clebsch_gordan/cartesian_spherical.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from featomic.clebsch_gordan import cartesian_to_spherical
66

7-
from .rotations import cartesian_rotation, WignerDReal
7+
from .rotations import WignerDReal, cartesian_rotation
88

99

1010
@pytest.fixture
@@ -382,9 +382,9 @@ def test_cartesian_to_spherical_rank_3_by_equation(cg_backend):
382382
assert operations.equal_metadata(l3_input, l3_reference)
383383
assert operations.allclose(l3_input, l3_reference)
384384

385+
385386
@pytest.mark.parametrize("cg_backend", ["python-dense", "python-sparse"])
386387
def test_cartesian_to_spherical_equivariance(cg_backend):
387-
388388
# Define a random cartesian rank 2 tensor
389389
random_rank_2_arr = np.random.rand(100, 3, 3, 1)
390390

@@ -396,10 +396,10 @@ def test_cartesian_to_spherical_equivariance(cg_backend):
396396

397397
# Rotate the cartesian tensor
398398
random_rank_2_arr_rot = (
399-
(
400-
random_rank_2_arr.copy().reshape(100, 3, 3) @ R.T
401-
).transpose(0, 2, 1) @ R.T
402-
).transpose(0, 2, 1).reshape(100, 3, 3, 1)
399+
((random_rank_2_arr.copy().reshape(100, 3, 3) @ R.T).transpose(0, 2, 1) @ R.T)
400+
.transpose(0, 2, 1)
401+
.reshape(100, 3, 3, 1)
402+
)
403403

404404
# Build the Cartesian TMs and do cartesian to spherical
405405
# Build the cartesian tensor and do cartesian to spherical

0 commit comments

Comments
 (0)