diff --git a/CHANGELOG.md b/CHANGELOG.md index 89f1857715..ee2e6c9a3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +# v1.3.1 - Bug fixes, Docker documentation update + +## Bug fixes +- #1259 Bug-fix for `ht.regression.Lasso()` on GPU (by @mrfh92) +- #1201 Fix `ht.diff` for 1-element-axis edge case (by @mtar) + +## Changes + +### Interoperability + +- #1257 Docker release 1.3.x update (by @JuanPedroGHM) + +### Maintenance + +- #1274 Update version before release (by @ClaudiaComito) +- #1267 Unit tests: Increase tolerance for `ht.allclose` on `ht.inv` operations for all torch versions (by @ClaudiaComito) +- #1266 Sync `pre-commit` configuration with `main` branch (by @ClaudiaComito) +- #1264 Fix Pytorch release tracking workflows (by @mtar) +- #1234 Update sphinx package requirements (by @mtar) +- #1187 Create configuration file for Read the Docs (by @mtar) + # v1.3.0 - Scalable SVD, GSoC`22 contributions, Docker image, PyTorch 2 support, AMD GPUs acceleration This release includes many important updates (see below). We particularly would like to thank our enthusiastic [GSoC2022](https://summerofcode.withgoogle.com/programs/2022) / tentative GSoC2023 contributors @Mystic-Slice @neosunhan @Sai-Suraj-27 @shahpratham @AsRaNi1 @Ishaan-Chandak 🙏🏼 Thank you so much! diff --git a/heat/core/arithmetics.py b/heat/core/arithmetics.py index a38f10c3a2..eed92c58c9 100644 --- a/heat/core/arithmetics.py +++ b/heat/core/arithmetics.py @@ -538,7 +538,8 @@ def diff( # build the slice for the first element on the specified axis arb_slice = [slice(None)] * len(a.shape) - arb_slice[axis] = 0 + if ret.lshape[axis] > 0: + arb_slice[axis] = 0 # send the first element of the array to rank - 1 if rank > 0: snd = ret.comm.Isend(ret.lloc[arb_slice].clone(), dest=rank - 1, tag=rank) @@ -554,7 +555,8 @@ def diff( if rank < size - 1: cr_slice = [slice(None)] * len(a.shape) # slice of 1 element in the selected axis for the shape creation - cr_slice[axis] = 1 + if ret.lshape[axis] > 1: + cr_slice[axis] = 1 recv_data = torch.ones( ret.lloc[cr_slice].shape, dtype=ret.dtype.torch_type(), device=a.device.torch_device ) diff --git a/heat/core/tests/test_arithmetics.py b/heat/core/tests/test_arithmetics.py index 7c2f9c8aa8..1c98da7f77 100644 --- a/heat/core/tests/test_arithmetics.py +++ b/heat/core/tests/test_arithmetics.py @@ -405,6 +405,15 @@ def test_diff(self): ht_diff = ht.diff(ht_array, n=0) self.assertTrue(ht.equal(ht_diff, ht_array)) + # edge cases + ht_arr = ht.ones((2, 1, 2), split=0) + ht_diff = ht.diff(ht_arr, axis=1) + self.assertEqual(ht_diff.gshape, (2, 0, 2)) + + ht_arr = ht.ones((2, 1, 2), split=1) + ht_diff = ht.diff(ht_arr, axis=1) + self.assertEqual(ht_diff.gshape, (2, 0, 2)) + # raises with self.assertRaises(ValueError): ht.diff(ht_array, n=-2)