[NOOP][clangformat][codemod] Enable CLANGFORMAT (#67854)

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/67854

Test Plan: Visual inspection. Sandcastle.

Reviewed By: zertosh

Differential Revision: D32173077

fbshipit-source-id: 10ab4b0afa18c7be4fab3e3564d9b479a7a48cb5
This commit is contained in:
Shashank Chaudhry
2021-11-04 13:59:35 -07:00
committed by Facebook GitHub Bot
parent 938bab0bfd
commit e8ac8c005d

View File

@ -440,18 +440,22 @@ c10::IValue make_custom_class(CtorArgs&&... args) {
return c10::IValue(std::move(userClassInstance));
}
// Alternative api for creating a torchbind class over torch::class_ this api is preffered to prevent size regressions
// on Edge usecases. Must be used in conjunction with TORCH_SELECTIVE_CLASS macro aka
// Alternative api for creating a torchbind class over torch::class_ this api is
// preffered to prevent size regressions on Edge usecases. Must be used in
// conjunction with TORCH_SELECTIVE_CLASS macro aka
// selective_class<foo>("foo_namespace", TORCH_SELECTIVE_CLASS("foo"))
template <class CurClass>
inline class_<CurClass> selective_class_(const std::string& namespace_name, detail::SelectiveStr<true> className) {
auto class_name = std::string(className.operator const char *());
inline class_<CurClass> selective_class_(
const std::string& namespace_name,
detail::SelectiveStr<true> className) {
auto class_name = std::string(className.operator const char*());
return torch::class_<CurClass>(namespace_name, class_name);
}
template <class CurClass>
inline detail::ClassNotSelected selective_class_(const std::string&, detail::SelectiveStr<false>) {
inline detail::ClassNotSelected selective_class_(
const std::string&,
detail::SelectiveStr<false>) {
return detail::ClassNotSelected();
}