daphne-eu / daphne

DAPHNE: An Open and Extensible System Infrastructure for Integrated Data Analysis Pipelines
Apache License 2.0
68 stars 62 forks source link

[daphneir] fix CastOp::inferTypes bug (#861) #862

Closed philipportner closed 1 month ago

philipportner commented 1 month ago

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 fix is required for #852 #853

Closes #861