From 3d4b9d413ea78f9b38432675a78cd5b9e8c08d0a Mon Sep 17 00:00:00 2001 From: Philipp Holl Date: Sun, 17 Dec 2023 17:07:05 +0100 Subject: [PATCH] Slice padding fix --- phiml/math/_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phiml/math/_ops.py b/phiml/math/_ops.py index 94b1da38..e28421bd 100644 --- a/phiml/math/_ops.py +++ b/phiml/math/_ops.py @@ -963,7 +963,7 @@ def to_lower_upper(s: slice, size: int) -> Tuple[int, int]: for width_i in widths_i: dim, lu = next(iter(width_i.items())) sum_widths_i[dim] += lu - padded_slices.append(mode[i].pad(x[i], sum_widths_i, **kwargs)) + padded_slices.append(mode[i].pad(x[i], {k: tuple(v) for k, v in sum_widths_i.items()}, **kwargs)) return stack(padded_slices, sel_dims) # for w in widths: # selection = {dim: i for dim, i in w.items() if not isinstance(i, slice)}