I have a numpy array like np.array([1, 2, 3])
Without using for loops but just use numpy or pytorch methods, i want a matrix with dimension len(array) * N * M composed by matrices N*M that the first matrix is composed by all ones, the second only by two values and the third only by 3 values.
For istance
N = 4 M = 3
[[[1,1,1,1],[1,1,1,1],[1,1,1,1]],
[[2,2,2,2],[2,2,2,2],[2,2,2,2]],
[[3,3,3,3],[3,3,3,3],[3,3,3,3]]]
I tried different methods to achive this matrix like unsqueeze and repeat but i wasn't able to find a solution, any suggestion?