Skip to content

Commit

Permalink
update strides
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasdiener committed Sep 30, 2024
1 parent 498d7e2 commit eab5edc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pyopencl/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,13 @@ def __setstate__(self, state):
else:
self.base_data = self.allocator(self.nbytes)

self.set(state["data"], queue=queue)
ary = state["data"]

# Mimics the stride update in _get() below
if ary.strides != self.strides:
ary = _as_strided(ary, strides=self.strides)

self.set(ary, queue=queue)

# }}}

Expand Down

0 comments on commit eab5edc

Please sign in to comment.