I added a test for the case of multiple shared remaining axes which failed. To fix it, I added Matmul._get_output_shape_from_returnn. Additionally, in Matmul.create_returnn_layer_dict, var1 and var2 should be created by inserting at the beginning of the list, not by appending. Otherwise, the output order in returnn is reversed.
I added a test for the case of multiple shared remaining axes which failed. To fix it, I added
Matmul._get_output_shape_from_returnn
. Additionally, inMatmul.create_returnn_layer_dict
,var1
andvar2
should be created by inserting at the beginning of the list, not by appending. Otherwise, the output order in returnn is reversed.