torch.Pool1dShape
export type Pool1dShape<S extends Shape> = S extends readonly [
infer B extends number,
infer C extends number,
number,
]
? readonly [B, C, number] // [B, C, L] -> [B, C, outL]
: S extends readonly [infer C extends number, number]
? readonly [C, number] // [C, L] -> [C, outL]
: DynamicShape;Sextends ShapeOutput shape for 1D pooling (input: [B, C, L] or [C, L]). Preserves batch and channel dimensions, output length is dynamic.
Examples
type Input3D = readonly [16, 64, 100]; // [B, C, L]
type Output3D = Pool1dShape<Input3D>; // [16, 64, number]
type Input2D = readonly [64, 100]; // [C, L]
type Output2D = Pool1dShape<Input2D>; // [64, number]