Unfortunately, there is a bug with einsum in 0.4 24 that has only been fixed in master 29. You could try if, similar to the original reporter’s case, passing x.clone() to the einsum function is a feasible workaround.
Best regards
Thomas