Skip to main content

from_transpose

Function from_transpose 

Source
pub fn from_transpose(
    spec: &TransposeSpec,
    names: &StageNames,
    float: bool,
    target: &SpatialTarget,
) -> Result<SpatialProgram, SpatialReject>
Expand description

Kt[j·rows + i] = X[i·cols + j] — a TRANSPOSE IS A MAP, not an operator.

★ A STAGE’S RESULT IS PLACED BY ITS ITERATION SPACE, so a flat result must iterate the flat output. Its element c = j·rows + i (new row j, new column i) is X[i·cols + j], and inside new row j’s band [j·rows, (j+1)·rows) that offset is c·cols + j·(1 − rows·cols) — affine. So a matrix transpose is cols bands of one read each: a map per band, still no operator.

★ A VECTOR TRANSPOSES TO ITSELF. A 1 × n row and an n × 1 column are the same flat sequence, so their transpose is one plain read — no bands at all.