Relative Content

Tag Archive for pythonmachine-learningdeep-learningpytorchtensor

Does this function find the memory address of the last element in a pytorch tensor?

I wanted to know if this function I made to find the memory address of the last element in a pytorch tensor works. I run it and it seems fine but a couple of times it returns the “last element” of the tensor and it shows that it is in a later part of memory than the first element, which I get using the .data_ptr() function. The tensor is contiguous and has dimensions (3,1000,1000).