torch.SliceShape
export type SliceShape<S extends Shape, Dim extends number, Length extends number> = NarrowShape<
S,
Dim,
Length
>;Sextends ShapeDimextends numberLengthextends numberCompute output shape of index operation with a range. Equivalent to Python's tensor[start:end] or tensor[:, start:end].
Examples
// Slicing [10, 20, 30] with [:, 5:15, :] → [10, 10, 30]
type Result = SliceShape<readonly [10, 20, 30], 1, 10>; // readonly [10, 10, 30]