Convert a Tensor to a Numpy Array or List in PyTorch
www.legendu.net › misc › blogMar 11, 2020 · Tensor to list¶ You can also convert a Tensor to a list using the method Tensor.tolist. If you work across different devices (CPU, GPU, etc.), it is suggested that you use Tensor.cpu().tolist. list(tensor) put all first-level element of tensor into a list. It is the reverse operation of torch.stack. This is not what you want, geneerally speaking.