- Notifications
You must be signed in to change notification settings - Fork 36
Closed
Description
The key part of the code is
foreach(i, S; Slices[1 .. $]) { static assert(isSlice!S == packs, "zip: all Slices must have the same shape packs"); assert(slices[i]._lengths == slices[0]._lengths, "zip: all slices must have the same lengths"); static if (sameStrides) assert(slices[i].unpack.strides == slices[0].unpack.strides, "zip: all slices must have the same strides"); }
note that the last part of the foreach is Slices[1..$], but then slices is indexed at slices[i]. The first iteration of the loop is i=0, so it's just comparing slices[0] to itself. If Slices.length is 1, then this is all that occurs.
There are two options to fix, either change the slices[i] to slices[i+1] or to S.
Metadata
Metadata
Assignees
Labels
No labels