-
Notifications
You must be signed in to change notification settings - Fork 27.4k
String defaults aren't handled well in native_functions.yaml #43944
Copy link
Copy link
Closed
Labels
module: codegenIssues related to the codegen for Aten and AutogradIssues related to the codegen for Aten and AutogradtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
A signature containing a string-typed argument with a literal default will get emitted to C++ without escaping the double quotes, i.e.
- func: myop(Tensor self, str s="HEY") -> Tensor
will emit
m.def("myop(Tensor self, str s="HEY") -> Tensor")
with the ensuing hilarity. Escaping the schema strings is easy, not sure what other issues might need to be dealt with around the initializers themselves. OTOH if we want to explicitly disallow string defaults[1], we should error at codegen time.
[1] though e.g. they're the obvious route to avoiding python facades in #42190
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
module: codegenIssues related to the codegen for Aten and AutogradIssues related to the codegen for Aten and AutogradtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module