Function torch::schema(const char *, c10::AliasAnalysisKind, bool)¶
Defined in File library.h
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));