How can I modify a tensor of rank 1 containing N int to a tensor of rank 2 containing N vector of size M with a dictionary
in python something like:
dict = {1 : [1,2,3] , 2 : [3,2,1]}
array1 = np.array([1,1,2,1,2])
array2 = np.array([dict[x] for x in array1])
but I cannot iterate over a Tensor (aside from while loop but I don't think it's the optimal solution)