A tensor view changes how existing storage is interpreted without copying its data. Its shape gives the logical extent, while its strides describe the step through storage for each dimension. section 5.2.2 section 5.2.3
For a two-dimensional index (i, j), the flat offset is i·stride0 + j·stride1. A Triton kernel can use runtime strides in this address calculation instead of inferring layout from shape. section 5.2.3
Transpose without moving data
A (3, 4) tensor with strides (4, 1) can have a transposed (4, 3) view with strides (1, 4). The original index (1, 2) and transposed index (2, 1) both resolve to offset 6. Copying is needed only when an operation requires contiguous row-major storage. section 5.2.2
Figure 5.3 Two tensor views sharing the same physical memory buffer. The original (3, 4) tensor with strides (4, 1) and its transposed (4, 3) view with strides (1, 4) both resolve physical element 6 to the same byte offset, proving no data is moved during transposition at the metadata level.
Compare the original tensor and its transposed view as mappings onto the same physical buffer. section 5.2.2







