torch.FunctionConfig
export interface FunctionConfig<
Name extends string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
F extends (...args: any[]) => any = (...args: any[]) => any,
> {
/**
* The function name.
*/
readonly name: Name;
/**
* The implementation. Type is captured for call-site type safety.
*/
readonly impl: F;
/**
* Optional namespace for the function.
*/
readonly namespace?: string;
/**
* Optional signature description.
*/
readonly signature?: string;
/**
* Optional dtype restriction.
*/
readonly dtypes?: readonly DType[];
}Nameextends stringFextends (...args: any[]) => any- readonly
name(Name) - – The function name.
- readonly
impl(F) - – The implementation. Type is captured for call-site type safety.
- readonly
namespace(string)optional - – Optional namespace for the function.
- readonly
signature(string)optional - – Optional signature description.
- readonly
dtypes(readonly DType[])optional - – Optional dtype restriction.
Full function configuration.
The generic F captures the actual function type for type safety at call sites, while internally we store as a general function type in the registry.