torch.tx.ShapeOf
export type ShapeOf<T> =
T extends Tensor<infer S, any, any> ? S : T extends number ? readonly [] : DynamicShape;TExtract shape from a Tensor type. Scalars (numbers) are treated as 0D tensors with shape [].
export type ShapeOf<T> =
T extends Tensor<infer S, any, any> ? S : T extends number ? readonly [] : DynamicShape;TExtract shape from a Tensor type. Scalars (numbers) are treated as 0D tensors with shape [].