Hi Eva (and Lart)!



 Eva:

torch.einsum('bk…,‘bk…->bk’),
…
it throws an error: " RuntimeError: shape ‘[32, 7]’ is invalid for input of size 3096576 ".


Please check your pytorch version – this looks like an einsum()
bug that got fixed somewhere along the line.  (I’m not sure exactly
when.)
Lart’s example works for me with a 1.8 nightly build, version
‘1.8.0.dev20210117’, but fails – giving your error – with an older
1.7 stable build, version ‘1.7.1’.
If you’re not using the current stable build (1.8.1), you might try
upgrading to that to see if things work.  (I haven’t tried it on the
1.8.1 stable build, but the 1.8.0 nightly version suggests that the
stable build should work.)
Best.
K. Frank