vortex_torch.indexer.reshape

Classes

Reshape(batch_dim, x2, y2)

Same-numel reshape of the inner two axes (indexer side).

class Reshape(batch_dim, x2, y2)[source]

Bases: vOp

Same-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 (the S axis is preserved); x2*y2 must equal the input’s x1*y1 (checked at trace time).

__call__:

y = op(x, ctx=ctx)x [S, x_1, y_1][S, x_2, y_2]. BATCHED iff the input is BATCHED, else RAGGED.

Parameters: