This is an extremely particular bug introduced by the recent optimizations to contractions involving scalar-like tensors. It affects contractions involving a scalar tensor with a non-scalar tensor, where the tensors have different element types. The cause of the bug is that we are using BLAS.axpby!, but in the mixed element type case, it gets dispatched to a generic Julia fallback. However, the generic Julia fallback and BLAS version handle NaN different with beta = 0. When beta = 0, BLAS overwrites the modified array with zeros, but Julia forwards the NaN. This is fixed by creating our own dispatch path for the mixed element type case.
This is an extremely particular bug introduced by the recent optimizations to contractions involving scalar-like tensors. It affects contractions involving a scalar tensor with a non-scalar tensor, where the tensors have different element types. The cause of the bug is that we are using
BLAS.axpby!
, but in the mixed element type case, it gets dispatched to a generic Julia fallback. However, the generic Julia fallback and BLAS version handleNaN
different withbeta = 0
. Whenbeta = 0
, BLAS overwrites the modified array with zeros, but Julia forwards theNaN
. This is fixed by creating our own dispatch path for the mixed element type case.