Skip to main content

~/notes

Data Science study notes. Code, thoughts, experiments.

PyTorch: Why view() fails after transpose()

transpose() makes tensors non-contiguous (logical ≠ physical order). view() only works with contiguous tensors → RuntimeError. Solution: Use reshape() instead of view()!

10/31/2025·Blog