Shortcuts

Function torch::schema(const char *, c10::AliasAnalysisKind, bool)

Function Documentation

inline c10::FunctionSchema torch::schema(const char *str, c10::AliasAnalysisKind k, bool allow_typevars = false)

Construct a c10::FunctionSchema from a string, with an explicitly specified c10::AliasAnalysisKind.

Ordinarily, schemas are simply passed in as strings, but if you need to specify a custom alias analysis, you can replace the string with a call to this function.

// Default alias analysis (FROM_SCHEMA)
m.def("def3(Tensor self) -> Tensor");
// Pure function alias analysis
m.def(torch::schema("def3(Tensor self) -> Tensor",
c10::AliasAnalysisKind::PURE_FUNCTION));

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources