vortex_torch.indexer.reshape¶
Classes
|
Same-numel reshape of the inner two axes (indexer side). |
- class Reshape(batch_dim, x2, y2)[source]¶
Bases:
vOpSame-numel reshape of the inner two axes (indexer side).
- Math:
- \[X\in\mathbb{R}^{S\times x_1\times y_1} \;\longrightarrow\; Y\in\mathbb{R}^{S\times x_2\times y_2},\qquad x_2\,y_2 = x_1\,y_1,\]
reading the flat \(x_1 y_1\) elements row-major into the new \((x_2, y_2)\) layout, independently per leading index \(s\) (a Triton-tile
tl.reshape(); no data movement beyond the existing load/store). - __init__:
Reshape(-1, x2, y2)— the leading dim must be-1(theSaxis is preserved);x2*y2must equal the input’sx1*y1(checked at trace time).- __call__:
y = op(x, ctx=ctx)—x[S, x_1, y_1]→[S, x_2, y_2].BATCHEDiff the input isBATCHED, elseRAGGED.- Parameters: