-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
It would be convenient to have an integer value for the unroll
argument of lax.scan
that unrolls the whole loop. (As opposed to the unergonomic and confusing situation of having to switch between integers and the boolean True
, not to be confused with 1
, which is confusingly equivalent to False
.)
I argue that 0 would be a natural choice for such a value.
unroll=n
splits a sequence of size k
into chunks of size n
followed by a chunk of size k mod n
.
Thus unroll=0
should split a sequence of size k
into chunks of size 0
(i.e. nothing) followed by a chunk of size k mod 0
.
But k mod 0 == k
. (See, e.g., here, here, here, and here.)
Therefore, unroll=0
should split a sequence into nothing followed by a chunk of size k
(i.e., the whole sequence).
If this proposal is agreeable, I can create a short PR for this.