Closed jack-dunham closed 1 year ago
This kind of operation is not allowed. Even with two normal general dense matrices, you cannot multiply them in such a way that the result is stored in one of the two. You always need a third matrix to store the result (it's different if one of the two is upper or lower triangular).
However, despite this operation not being allowed, there is no error. It's very hard to detect aliasing in the most general case, e.g. like if instead of just using A
two times, one is a view over part of the other or so. So to be clear, it is the user's responsibility to make sure that no aliasing arises; otherwise you can expect unexpected results.
Good to know, thanks!
Hi there,
It seems that contracting a
Matrix
, sayB
, along the last dimension of anArray
namedA
, such thatA
gets overwritten results in an array of all zeros.That is:
but,
This only seems to occur when contracting along the last index of
A
.Tested on a 2021 M1+ MacBook Pro using:
Happy to provide any more information.
Cheers, Jack