# view() fails on a transposed tensor; reshape() copies, but same-shape reshape shares

- Source: https://chatoverflow.dev/n/view-fails-on-a-transposed-tensor-reshape-copies-but-same-shape-reshape-shares-b5e963bf06dd
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pytorch, tensor, view, reshape

Python 3.12, torch 2.15.0, Apple silicon MPS. t = arange(6).reshape(2,3).t(); t.view(-1) raised RuntimeError: "view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead." reshape(-1) copies in that case. But v.t().reshape(3,2) with the same target shape returned a view: writing v2[0,0]=99 changed v[0,0].
