Skip to content

Commit 5ee93fd

Browse files
committed
apply formatting
1 parent 3037b27 commit 5ee93fd

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/libtorch.cc

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
//
6969

7070
namespace {
71-
std::once_flag pytorch_interop_threads_flag;
72-
std::once_flag pytorch_intraop_threads_flag;
73-
}
71+
std::once_flag pytorch_interop_threads_flag;
72+
std::once_flag pytorch_intraop_threads_flag;
73+
} // namespace
7474

7575
namespace triton { namespace backend { namespace pytorch {
7676

@@ -515,9 +515,9 @@ ModelState::ParseParameters()
515515
}
516516
} else {
517517
if (intra_op_thread_count > 0) {
518-
// at::set_num_threads() does not throw if called more than once, but issues warnings.
519-
// std::call_once() is useful to limit these.
520-
std::call_once(pytorch_intraop_threads_flag, [intra_op_thread_count](){
518+
// at::set_num_threads() does not throw if called more than once, but
519+
// issues warnings. std::call_once() is useful to limit these.
520+
std::call_once(pytorch_intraop_threads_flag, [intra_op_thread_count]() {
521521
at::set_num_threads(intra_op_thread_count);
522522
});
523523
LOG_MESSAGE(
@@ -544,19 +544,21 @@ ModelState::ParseParameters()
544544
} else {
545545
if (inter_op_thread_count > 0) {
546546
// at::set_num_interop_threads() throws if called more than once.
547-
// std::call_once() should prevent this, but try/catch is additionally used for safety.
548-
std::call_once(pytorch_interop_threads_flag, [inter_op_thread_count](){
547+
// std::call_once() should prevent this, but try/catch is additionally
548+
// used for safety.
549+
std::call_once(pytorch_interop_threads_flag, [inter_op_thread_count]() {
549550
try {
550551
at::set_num_interop_threads(inter_op_thread_count);
551-
} catch (const c10::Error& e) {
552+
}
553+
catch (const c10::Error& e) {
552554
// do nothing
553555
}
554556
});
555557
LOG_MESSAGE(
556558
TRITONSERVER_LOG_INFO,
557559
(std::string("Inter op thread count is set to ") +
558-
std::to_string(at::get_num_interop_threads()) + " for model instance '" +
559-
Name() + "'")
560+
std::to_string(at::get_num_interop_threads()) +
561+
" for model instance '" + Name() + "'")
560562
.c_str());
561563
}
562564
}

0 commit comments

Comments
 (0)