torch.ValidateRanks
export type ValidateRanks<
E extends string,
Shapes extends readonly Shape[],
> = Shapes extends readonly [infer First extends Shape, ...infer Rest extends readonly Shape[]]
? ValidateTensorRankAt<E, 0, First['length']> extends true
? Rest extends readonly []
? true
: ValidateRanksRest<E, Rest, 1>
: ValidateTensorRankAt<E, 0, First['length']>
: true;Eextends stringShapesextends readonly Shape[]Validate that all operand ranks match their subscripts.