I want to convert this particular einsum expression to Julia. What is the most Julia way to do this?
Python code
import numpy as np
x = np.arange(2*3*4*5*4).reshape(2, 3, 4, 5, 4)
np.einsum('ijklk->ijkl', x[:,:,1,:,:,1,:])[:] += <some_appropriate_tensor>
The problem that I face is that I want the addition to affect x directly like in the case of using einsum. I am not able to recreate the same functionality with views because the einsum notation is complex for me. What would be that best way to go about converting this to Julia?
Any advice with understanding the einsum notation is also welcomed. Any help would be appreciated and thanks in advance.