The Python Oracle

What does .contiguous() do in PyTorch?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Track title: CC P Beethoven - Piano Sonata No 2 in A

--

Chapters
00:00 Question
00:18 Accepted answer (Score 327)
02:08 Answer 2 (Score 45)
02:54 Answer 3 (Score 35)
05:17 Answer 4 (Score 22)
07:56 Thank you

--

Full question
https://stackoverflow.com/questions/4891...

Answer 1 links:
[pytorch documentation]: http://pytorch.org/docs/master/tensors.h...

Answer 2 links:
[image]: https://i.stack.imgur.com/wXGEz.png
[image]: https://i.stack.imgur.com/VCsT4.png
[image]: https://i.stack.imgur.com/oXcQ8.png
[image]: https://i.stack.imgur.com/uEQ1A.png
[stride()]: https://pytorch.org/docs/stable/generate...
[image]: https://i.stack.imgur.com/it1wI.png
[image]: https://i.stack.imgur.com/yIoaz.png
[contiguous()]: https://pytorch.org/docs/stable/generate...
[image]: https://i.stack.imgur.com/t6xEv.png
[reshape()]: https://stackoverflow.com/a/69637289/481...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #memory #pytorch #contiguous

#avk47