Skip to content

Commit

Permalink
feat(//core/conversion): Adding error prefix to python source traceback
Browse files Browse the repository at this point in the history
Signed-off-by: Naren Dasan <naren@narendasan.com>
Signed-off-by: Naren Dasan <narens@nvidia.com>
  • Loading branch information
narendasan committed Jul 22, 2021
1 parent 91f2559 commit 4bf2a41
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/conversion/conversion.cpp
Expand Up @@ -487,18 +487,20 @@ bool VerifyConverterSupportForBlock(const torch::jit::Block* b) {
unsupported_msg << "https://www.github.com/nvidia/TRTorch/issues" << std::endl;
unsupported_msg << std::endl << "In Module:" << std::endl;

LOG_ERROR(unsupported_msg.str());

for (const auto n : b->nodes()) {
auto schema = n->maybeSchema();
if (schema) {
for (const auto& x : unsupported_ops) {
if (x.first == schema->operator_name()) {
unsupported_msg << " Unsupported operator: " << *schema << std::endl;
unsupported_msg << trtorch::core::util::GetPyTorchSourceCode(n) << std::endl;
LOG_ERROR(
"Unsupported operator: " << *schema << std::endl
<< trtorch::core::util::GetPyTorchSourceCode(n) << std::endl);
}
}
}
}
LOG_ERROR(unsupported_msg.str());
return false;
}

Expand Down

0 comments on commit 4bf2a41

Please sign in to comment.