vortex_torch.indexer.mask¶
Classes
|
Position-dependent slice mask over one inner axis. |
- class MaskSlice(start, end, dim, alpha=1.0, beta=0.0)[source]¶
Bases:
vOpPosition-dependent slice mask over one inner axis.
- Math:
For target axis
dim(1→ \(D_0\),2→ \(D_1\)) and index \(i\) along it (other axes broadcast unchanged):\[\begin{split}Y_{\dots,i,\dots} = \begin{cases} \alpha, & \text{start} \le i < \text{end}, \\ \beta, & \text{otherwise}. \end{cases}\end{split}\]- __init__:
MaskSlice(start, end, dim, alpha=1.0, beta=0.0)— write \(\alpha\) on[start, end)of axisdim(1 or 2) and \(\beta\) elsewhere.- __call__:
y = op(x, ctx=ctx)—x[S, D_0, D_1]→ same shape. A pure position writer (xvalues are unused); output isBATCHEDiffxis.- Note:
only
dim ∈ {1, 2}(the packedSaxis is structural).- Parameters: