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
this is similar to the last issue but i think it may be an actual bug so opened a new issue:
let a =Mat.create 20let v =Vec.create 0let w = gemv a v
let d =Vec.dim w
here, i get 2, and w is a vector with uninitialized entries. this seems wrong?
i would argue that actually a vector 0. 0. would be the mathematically correct result. each entry of the result vector w is the scalar product of the corresponding row vector of the input matrix aand the input vector v. since these have length 0, the scalar product is an empty sum and should be 0.
alternatively one may argue that empty inputs are pathological. then it would make sense to raise an exception, similar to what gemv already does.
right now, it's not ideal that a nonsensical result is actually returned, in my opinion. if this is what lapack does, maybe one should protect the user from lapack here?
(edit: nonsense removal)
The text was updated successfully, but these errors were encountered:
i guess the lapack logic is "empty scalar product => we do nothing to the allocated output memory". from a CS perspective that kind of makes sense. still i find it a bit of a trap.
This is related to #22. BLAS/LAPACK sadly does not handle such corner cases in a mathematically appealing way. It would seem excessive to try to work around these issues, which are probably frequent in BLAS/LAPACK. Users should avoid passing values with degenerate dimensionality or zero operation sizes to BLAS/LAPACK to avoid triggering unexpected behavior. User code should check for degenerate conditions and either raise exceptions or provide explicit workarounds for these cases.
this is similar to the last issue but i think it may be an actual bug so opened a new issue:
here, i get
2
, andw
is a vector with uninitialized entries. this seems wrong?i would argue that actually a vector
0. 0.
would be the mathematically correct result. each entry of the result vectorw
is the scalar product of the corresponding row vector of the input matrixa
and the input vectorv
. since these have length 0, the scalar product is an empty sum and should be 0.alternatively one may argue that empty inputs are pathological. then it would make sense to raise an exception, similar to what
gemv
already does.right now, it's not ideal that a nonsensical result is actually returned, in my opinion. if this is what lapack does, maybe one should protect the user from lapack here?
(edit: nonsense removal)
The text was updated successfully, but these errors were encountered: