Skip to content

Commit

Permalink
[NOOP][clangformat][codemod] Enable CLANGFORMAT (pytorch#67854)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: pytorch#67854

Test Plan: Visual inspection. Sandcastle.

Reviewed By: zertosh

Differential Revision: D32173077

fbshipit-source-id: 10ab4b0afa18c7be4fab3e3564d9b479a7a48cb5
  • Loading branch information
gandalf2390 authored and facebook-github-bot committed Nov 4, 2021
1 parent 938bab0 commit e8ac8c0
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions torch/custom_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit e8ac8c0

Please sign in to comment.