Skip to content

Commit

Permalink
Revert "Distributed Fast Fourier Transforms (#1218)"
Browse files Browse the repository at this point in the history
This reverts commit 8b87890.
  • Loading branch information
ClaudiaComito committed Nov 28, 2023
1 parent 8b87890 commit 2e91d87
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 1,410 deletions.
1 change: 0 additions & 1 deletion heat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from . import core
from . import classification
from . import cluster
from . import fft
from . import graph
from . import naive_bayes
from . import nn
Expand Down
11 changes: 3 additions & 8 deletions heat/core/stride_tricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,7 @@ def sanitize_axis(
"""
# scalars are handled like unsplit matrices
original_axis = axis
ndim = len(shape)

if ndim == 0:
if len(shape) == 0:
axis = None

if axis is not None and not isinstance(axis, int) and not isinstance(axis, tuple):
Expand All @@ -163,9 +160,7 @@ def sanitize_axis(
axis = tuple(dim + len(shape) if dim < 0 else dim for dim in axis)
for dim in axis:
if dim < 0 or dim >= len(shape):
raise ValueError(
f"axis {original_axis} is out of bounds for {ndim}-dimensional array"
)
raise ValueError(f"axis {axis} is out of bounds for shape {shape}")
return axis

if axis is None or 0 <= axis < len(shape):
Expand All @@ -174,7 +169,7 @@ def sanitize_axis(
axis += len(shape)

if axis < 0 or axis >= len(shape):
raise ValueError(f"axis {original_axis} is out of bounds for {ndim}-dimensional array")
raise ValueError(f"axis {axis} is out of bounds for shape {shape}")

return axis

Expand Down
8 changes: 4 additions & 4 deletions heat/core/tests/test_suites/basic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ def assert_array_equal(self, heat_array, expected_array):
f"Local shapes do not match. Got {heat_array.lshape} expected {expected_array[slices].shape}",
)
# compare local tensors to corresponding slice of expected_array
is_allclose = torch.tensor(
np.allclose(heat_array.larray.cpu(), expected_array[slices]), dtype=torch.int32
is_allclose = np.allclose(heat_array.larray.cpu(), expected_array[slices])
ht_is_allclose = ht.array(
[is_allclose], dtype=ht.bool, is_split=0, device=heat_array.device
)
heat_array.comm.Allreduce(MPI.IN_PLACE, is_allclose, MPI.SUM)
self.assertTrue(is_allclose == heat_array.comm.size)
self.assertTrue(ht.all(ht_is_allclose))

def assert_func_equal(
self,
Expand Down
5 changes: 0 additions & 5 deletions heat/fft/__init__.py

This file was deleted.

Loading

0 comments on commit 2e91d87

Please sign in to comment.