Skip to content

Commit 9a48752

Browse files
authored
Merge pull request #1 from narendasan/raise_error_with_better_pytorch_traceback
Adding error prefix to pytorch traceback
2 parents 91f2559 + 4bf2a41 commit 9a48752

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/conversion/conversion.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,18 +487,20 @@ bool VerifyConverterSupportForBlock(const torch::jit::Block* b) {
487487
unsupported_msg << "https://www.github.com/nvidia/TRTorch/issues" << std::endl;
488488
unsupported_msg << std::endl << "In Module:" << std::endl;
489489

490+
LOG_ERROR(unsupported_msg.str());
491+
490492
for (const auto n : b->nodes()) {
491493
auto schema = n->maybeSchema();
492494
if (schema) {
493495
for (const auto& x : unsupported_ops) {
494496
if (x.first == schema->operator_name()) {
495-
unsupported_msg << " Unsupported operator: " << *schema << std::endl;
496-
unsupported_msg << trtorch::core::util::GetPyTorchSourceCode(n) << std::endl;
497+
LOG_ERROR(
498+
"Unsupported operator: " << *schema << std::endl
499+
<< trtorch::core::util::GetPyTorchSourceCode(n) << std::endl);
497500
}
498501
}
499502
}
500503
}
501-
LOG_ERROR(unsupported_msg.str());
502504
return false;
503505
}
504506

0 commit comments

Comments
 (0)