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
import Surge
letX=Matrix<Float>([[1]])letY=Matrix<Float>([[]])print("X")print(X)// Okprint("Y")print(Y)// Okprint("X*Y")print(X*Y)// Hard crash
Output:
X
( 1.0 )
Y
( )
X*Y
ldb must be >= MAX(N,1): ldb=0 N=0ldc must be >= MAX(N,1): ldc=0 N=0BLAS error: Parameter number 11 passed to cblas_sgemm had an invalid value
When run like swift <script>.swift, process prints that error msg and exits -1 (= 255), without printing a stacktrace. When run in Xcode, debugger doesn't activate.
Seems like Surge mul() needs to guard against the rows=0 / columns=0 cases and return an appropriate empty Matrix, instead of letting blas crash?
The text was updated successfully, but these errors were encountered:
jdanbrown
changed the title
Hard crash when multiplying by empty matrix (process exits 0)
Hard crash when multiplying by empty matrix
Nov 30, 2018
jdanbrown
changed the title
Hard crash when multiplying by empty matrix
Hard crash when multiplying by empty matrix (process exits -1)
Nov 30, 2018
Thanks! But what do you think about returning an empty/zero matrix instead of treating it as an error? That seems less surprising mathematically, since empty matrices are valid objects. That's what e.g. numpy chooses to do:
Output:
When run like
swift <script>.swift
, process prints that error msg and exits -1 (= 255), without printing a stacktrace. When run in Xcode, debugger doesn't activate.Seems like Surge
mul()
needs to guard against the rows=0 / columns=0 cases and return an appropriate empty Matrix, instead of letting blas crash?The text was updated successfully, but these errors were encountered: