The tensor I need to initialize is of shape (3,3,2). So there are 3 matrices of shape (3,2) that I need to initialize the following way:
1st matrix: [[x1, x2],[0,0],[0,0]]
2nd matrix: [[0,0], [x1, x2],[0,0]]
3rd matrix: [[0,0], [0,0], [x1, x2]]
I am given x(numpy array) as an input. I am having trouble figuring out the loop to initialize a tensor using numpy.
y= np.zeros((3, 3, 2))
for i in range(3):
for j in range(3):
for k in range(2):
y[i,j,k] = ?
I think given x, I'm going about this the wrong way. Any help is appreciated!