Skip to content Skip to sidebar Skip to footer

Pytorch Tensor Storages Have The Same Id When Calling The Storage() Method

I'm learning about tensor storage through a blog (in my native language - Viet), and after experimenting with the examples, I found something that was difficult to understand. Give

Solution 1:

After searching on the Pytorch discuss forum and Stack Overflow, I see that the method data_ptr() should be used in the comparison of locations of tensors (according to the Python discuss in the question and this link) (although it is not totally correct, check the first Python discuss for a better comparison method)

About the id part, there have been many questions on this topic on Stack Overflow. I saw one question here that has many answers which can clear up most part of the question above. I also have some misunderstanding on the id and the memory allocation of objects, which has also been answered in the comment section of my recent question

Post a Comment for "Pytorch Tensor Storages Have The Same Id When Calling The Storage() Method"