4 ms·
transpose? In the sense that [[1,2,3,4,5],[6,7,8,9,10]] Becomes [[1,6],[2,7],[3,8],[4,9],[5,10]]
by quickthrower2 3y ago
transpose? In the sense that
[[1,2,3,4,5],[6,7,8,9,10]]
Becomes
[[1,6],[2,7],[3,8],[4,9],[5,10]]
- skrebbel 3y agoWoa! Of course!
- quickthrower2 3y agoAnd if you use PyTorch, its O(1) operation. You just change how you index into the data.
- toth 3y agoI believe numpy introduced ndarrays with user-specified strides, that made this a O(1) operation. Even if not, it certainly predates pytorch in this regard. Pytorch (and other tensor libraries) just used the ndarray concept from numpy.
- quickthrower2 3y agoThanks yeah I didn’t mean to imply that Pytorch invented the idea