This patch fixes a bug in the CastOp::inferTypes implementation. For a matrix type of unknown value type, it resets the matrix type by calling our custom builder MatrixType::get(ctx, valueType) instead of using the matrix type of the result matrix and only replacing the unknown value type.
This means that for example, casts from daphne.Matrix<?x?x!daphne.Unknown> to
daphne.Matrix<?x?x!daphne.Unknown:rep[sparse]>, the matrix representation would reset and the cast is no longer casting from dense to sparse.
This patch fixes a bug in the
CastOp::inferTypes
implementation. For a matrix type of unknown value type, it resets the matrix type by calling our custom builderMatrixType::get(ctx, valueType)
instead of using the matrix type of the result matrix and only replacing the unknown value type.This means that for example, casts from
daphne.Matrix<?x?x!daphne.Unknown>
todaphne.Matrix<?x?x!daphne.Unknown:rep[sparse]>
, the matrix representation would reset and the cast is no longer casting from dense to sparse.This fix is required for #852 #853
Closes #861