List of tensor elements to nubers

Just need to convert this list of tensors to an ordinary list.
From:
[tensor([33]), tensor([7]), tensor([8]), tensor([11]), tensor([17]), tensor([20]), tensor([23]), tensor([24]), tensor([25]), tensor([26])]

To:
x = [33, 7, 8,..., 26]

import torch
x = [torch.LongTensor([i]) for i in [33, 7, 8, 11, 17, 20, 23, 24, 25, 26] ]
torch.cat(x).tolist()
1 Like