-
Notifications
You must be signed in to change notification settings - Fork 22.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PyTorch] Make c10::str(const char*) return const char* #52222
Conversation
`c10::str()` is often used with variadic macros. It can be more efficient to get a C string out if you put a C string in, like if you are able to defer std::string creation to an outlined function or even never do it at all. Meanwhile, there is an implicit conversion from const char* to std::string, so users who expected a std::string will still make one. Differential Revision: [D26419663](https://our.internmc.facebook.com/intern/diff/D26419663/) [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit fc6714d (more details on the Dr. CI page):
🕵️ 2 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages: pytorch_linux_xenial_py3_6_gcc5_4_test (1/2)Step: "Run tests" (full log | diagnosis details | 🔁 rerun)
|
`c10::str()` is often used with variadic macros. It can be more efficient to get a C string out if you put a C string in, like if you are able to defer std::string creation to an outlined function or even never do it at all. Meanwhile, there is an implicit conversion from const char* to std::string, so users who expected a std::string will still make one. Differential Revision: [D26419663](https://our.internmc.facebook.com/intern/diff/D26419663/) [ghstack-poisoned]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
`c10::str()` is often used with variadic macros. It can be more efficient to get a C string out if you put a C string in, like if you are able to defer std::string creation to an outlined function or even never do it at all. Meanwhile, there is an implicit conversion from const char* to std::string, so users who expected a std::string will still make one. Differential Revision: [D26419663](https://our.internmc.facebook.com/intern/diff/D26419663/) [ghstack-poisoned]
`c10::str()` is often used with variadic macros. It can be more efficient to get a C string out if you put a C string in, like if you are able to defer std::string creation to an outlined function or even never do it at all. Meanwhile, there is an implicit conversion from const char* to std::string, so users who expected a std::string will still make one. Differential Revision: [D26419663](https://our.internmc.facebook.com/intern/diff/D26419663/) [ghstack-poisoned]
This pull request has been merged in d675593. |
Summary: Pull Request resolved: pytorch#52222 `c10::str()` is often used with variadic macros. It can be more efficient to get a C string out if you put a C string in, like if you are able to defer std::string creation to an outlined function or even never do it at all. Meanwhile, there is an implicit conversion from const char* to std::string, so users who expected a std::string will still make one. ghstack-source-id: 121877052 (Note: this ignores all push blocking failures!) Test Plan: CI Reviewed By: bhosmer Differential Revision: D26419663 fbshipit-source-id: 400bef71e6a0004b5914f5f511ea0e04e0d7599b
Summary: Pull Request resolved: pytorch#52222 `c10::str()` is often used with variadic macros. It can be more efficient to get a C string out if you put a C string in, like if you are able to defer std::string creation to an outlined function or even never do it at all. Meanwhile, there is an implicit conversion from const char* to std::string, so users who expected a std::string will still make one. ghstack-source-id: 121877052 (Note: this ignores all push blocking failures!) Test Plan: CI Reviewed By: bhosmer Differential Revision: D26419663 fbshipit-source-id: 400bef71e6a0004b5914f5f511ea0e04e0d7599b
Summary: Pull Request resolved: pytorch#52222 `c10::str()` is often used with variadic macros. It can be more efficient to get a C string out if you put a C string in, like if you are able to defer std::string creation to an outlined function or even never do it at all. Meanwhile, there is an implicit conversion from const char* to std::string, so users who expected a std::string will still make one. ghstack-source-id: 121877052 (Note: this ignores all push blocking failures!) Test Plan: CI Reviewed By: bhosmer Differential Revision: D26419663 fbshipit-source-id: 400bef71e6a0004b5914f5f511ea0e04e0d7599b
Stack from ghstack:
c10::str()
is often used with variadic macros. It can be more efficient to get a C string out if you put a C string in, like if you are able to defer std::string creation to an outlined function or even never do it at all. Meanwhile, there is an implicit conversion from const char* to std::string, so users who expected a std::string will still make one.Differential Revision: D26419663