torch.OuterShape
export type OuterShape<S1 extends Shape, S2 extends Shape> = number extends S1['length']
? DynamicShape
: number extends S2['length']
? DynamicShape
: S1 extends readonly [infer M extends number]
? S2 extends readonly [infer N extends number]
? readonly [M, N]
: DynamicShape
: DynamicShape;S1extends ShapeS2extends ShapeCompute output shape of outer product. For 1D vectors [M] and [N], returns [M, N].
Examples
type R1 = OuterShape<readonly [3], readonly [4]>; // readonly [3, 4]
type R2 = OuterShape<readonly [5], readonly [2]>; // readonly [5, 2]