How to use the torch.Tensor.tolist () method
In this issue, the editor will bring you about how to use the torch.Tensor.tolist () method. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
Original text and translation:
Tolist () method: tolist () "tolist ()-> list or number tolist ()-> returns a list or numeric Returns the tensor as a (nested) list. For scalars, a standard Python number is returned, just like with item (). Tensors are automatically moved to the CPU first if necessary.This operation is not differentiable.Examples: > a = torch.randn (2,2) > a.tolist () [0.01276693582600803,0.5415473580360413], [- 0.08909505605697632,0.7729271650314331] > > a [0c0] .tolist () 0.012766935862600803 above is how the torch.Tensor.tolist () method is used. If you happen to have similar doubts, please refer to the above analysis for understanding. If you want to know more about it, you are welcome to follow the industry information channel.