Is .contiguous().flatten() the same as .view(-1) in PyTorch?

Are these exactly the same?

myTensor.contiguous().flatten()
myTensor.view(-1)

Will they return the same auto grad function etc?



Read more here: https://stackoverflow.com/questions/67214586/is-contiguous-flatten-the-same-as-view-1-in-pytorch

Content Attribution

This content was originally published by Dylan Kerler at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: