Right now this is Chain + Chain. Evaluating that expression is wasteful because both sides will need to be evaluated.
Instead changes the types such that the expression becomes Chain + Product<SubMat, SubMat>, then we can always eval the LHS, and use that allocation to store the operation.
Right now this is
Chain + Chain
. Evaluating that expression is wasteful because both sides will need to beeval
uated.Instead changes the types such that the expression becomes
Chain + Product<SubMat, SubMat>
, then we can always eval the LHS, and use that allocation to store the operation.