Skip to content

Commit 687ede6

Browse files
committed
Add clarifying comment
1 parent f7667f3 commit 687ede6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/blosc2/proxy.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,9 @@ def __getitem__(self, item: slice | list[slice]) -> np.ndarray:
671671
if not hasattr(out, "shape") or out.shape == ():
672672
return out
673673
else:
674-
return np.asarray(out) # avoids copy for PyTorch at least
674+
# avoids copy for PyTorch (JAX/Tensorflow will always copy,
675+
# no easy way around it)
676+
return np.asarray(out)
675677

676678

677679
def as_simpleproxy(*arrs: Sequence[blosc2.Array]) -> tuple[SimpleProxy | blosc2.Operand]:

0 commit comments

Comments
 (0)