torch.InputsFor
export type InputsFor<Op extends OpName> = OpSchemas[Op] extends BinaryOpSchema
? { a: TensorLike; b: TensorLike }
: OpSchemas[Op] extends UnaryOpSchema<infer _N, infer _SR, infer _DR, infer P>
? { input: TensorLike } & P
: OpSchemas[Op] extends ReductionOpSchema
? { input: TensorLike }
: { input: TensorLike };Opextends OpNameDerive input type from operation schema.
Binary operations have inputs (a, b). Unary and reduction operations have single input. Unary operations may also have extra parameters from the schema.