@@ -428,8 +428,8 @@ std::string ConvertBlockToEngine(const torch::jit::Block* b, ConversionInfo buil
428
428
return engine;
429
429
}
430
430
431
- std::set<std::string> GetUnsupportedOpsInBlock (const torch::jit::Block* b) {
432
- std::set<std::string> unsupported_ops;
431
+ std::set<std::pair<std:: string, std::string> > GetUnsupportedOpsInBlock (const torch::jit::Block* b) {
432
+ std::set<std::pair<std:: string, std::string> > unsupported_ops;
433
433
for (const auto n : b->nodes ()) {
434
434
if (n->kind () != torch::jit::prim::Loop && n->kind () != torch::jit::prim::If && !OpSupported (n)) {
435
435
auto schema = n->maybeSchema ();
@@ -438,7 +438,9 @@ std::set<std::string> GetUnsupportedOpsInBlock(const torch::jit::Block* b) {
438
438
" Unable to get schema for Node " << util::node_info (n) << " (conversion.VerifyCoverterSupportForBlock)" );
439
439
std::stringstream ss;
440
440
ss << *schema;
441
- unsupported_ops.insert (ss.str ());
441
+ std::string pytorch_code = trtorch::core::util::GetPyTorchSourceCode (n);
442
+ auto current_unsupported_op = std::make_pair (ss.str (), pytorch_code);
443
+ unsupported_ops.insert (current_unsupported_op);
442
444
}
443
445
for (const auto sub_b : n->blocks ()) {
444
446
auto sub_b_unsupported_ops = GetUnsupportedOpsInBlock (sub_b);
@@ -480,7 +482,8 @@ bool VerifyConverterSupportForBlock(const torch::jit::Block* b) {
480
482
unsupported_msg << " Method requested cannot be compiled by TRTorch.\n Unsupported operators listed below:"
481
483
<< std::endl;
482
484
for (auto s : unsupported_ops) {
483
- unsupported_msg << " - " << s << std::endl;
485
+ unsupported_msg << " - " << s.first << std::endl;
486
+ unsupported_msg << " Related PyTorch code:" << std::endl << s.second << std::endl;
484
487
}
485
488
unsupported_msg << " You can either implement converters for these ops in your application or request implementation"
486
489
<< std::endl;
0 commit comments