torch.ValidatedReduceShape
export type ValidatedReduceShape<Pattern extends string, InputShape extends Shape> =
ReduceShape<Pattern, InputShape> extends infer R
? R extends { readonly __isShapeError: true }
? R & readonly number[]
: R extends readonly number[]
? R
: DynamicShape
: DynamicShape;Patternextends stringInputShapeextends ShapeValidated reduce shape.