You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just upgraded to my project to use ndarray master in order to be able to use #1386, but discovered that these are failing with thread [test name] has overflowed its stack. (It's a two-dimensional array where both dimensions are 1, perhaps an easy edge-case to overlook.)
I was about to say, "I guess I'm glad I caught this before the eventual 0.16 release", but it looks like 0.16 came out four hours ago?
#[test]fntest_tril(){let a:Array2<f32> = Array2::ones((1,1));let b = a.tril(0);}#[test]fntest_triu(){let a:Array2<f32> = Array2::ones((1,1));let b = a.triu(0);}
The text was updated successfully, but these errors were encountered:
@akern40 The documentation's promise of "the array with elements below/above the kth diagonal zeroed" would seem to imply that the sole entry of array![[1]].triu(k) should be 1 when k is zero or negative and 0 when k is positive, and that of array![[1]].tril(k) should be 1 when k is zero or positive and 0 when k is negative—and that is the behavior I'm seeing from PyTorch.
The context in which this bit me was while implementing attention in a neural network model: there's a part where you're supposed to mask everything above the main diagonal of a square matrix, but if there was only one input token, then the matrix is 1×1.
I just upgraded to my project to use
ndarray
master in order to be able to use #1386, but discovered that these are failing withthread [test name] has overflowed its stack
. (It's a two-dimensional array where both dimensions are 1, perhaps an easy edge-case to overlook.)I was about to say, "I guess I'm glad I caught this before the eventual 0.16 release", but it looks like 0.16 came out four hours ago?
The text was updated successfully, but these errors were encountered: