torch.Conv2dShape
export type Conv2dShape<S extends Shape, OutChannels extends number> = S extends readonly [
infer B extends number,
number,
number,
number,
]
? readonly [B, OutChannels, number, number]
: S extends readonly [number, number, number]
? readonly [OutChannels, number, number]
: DynamicShape;Sextends ShapeOutChannelsextends numberOutput shape for 2D convolution. Input: [B, Cin, H, W], Output: [B, Cout, outH, outW] Channel dimension changes to out_channels, spatial dims are dynamic.
Examples
type Input = readonly [16, 3, 224, 224]; // [B, Cin, H, W]
type Output = Conv2dShape<Input, 64>; // [16, 64, number, number]