Open jwoo098 opened 1 month ago
Also brings up the question of how to handle a transpose, as these operations are frequently paired. Seems a bit heavy-handed to create a new node just to handle it, but it could also be a huge pain to implement within the node itself and might not be consistent with the design philosophy of other parts of the model.
It would be a new node, similar to the existing ReshapeNode. The good news is that by messing around with strides etc, we can avoid having to hold the array at all! We would need to do some transposition of the updates that are propagated. But overall the node would be pretty light weight.
It also wouldn't support dynamic arrays, because arrays can only be dynamic in the 0th axis.
Added an issue https://github.com/dwavesystems/dwave-optimization/issues/160
A symbol that would return the matrix product of two arrays (similar to numpy.matmul)