|
6 | 6 | #include "core/conversion/evaluators/evaluators.h"
|
7 | 7 | #include "core/conversion/var/Var.h"
|
8 | 8 | #include "core/util/prelude.h"
|
9 |
| - |
| 9 | +#include <ATen/core/operator_name.h> |
10 | 10 | #include "c10/util/intrusive_ptr.h"
|
11 | 11 | #include "core/conversion/converters/converter_util.h"
|
12 | 12 | #include "core/conversion/tensorcontainer/TensorContainer.h"
|
@@ -491,11 +491,20 @@ std::unordered_map<c10::OperatorName, std::string> GetUnsupportedOpsInBlock(cons
|
491 | 491 | auto schema = n->maybeSchema();
|
492 | 492 | // Some ops like torch::jit::prim::Loop, torch::jit::prim::If, torch::jit::prim::DictConstruct don't have a schema but they are supported.
|
493 | 493 | // torch::jit::prim::DictConstruct is supported via fallback only
|
494 |
| - if (schema && !OpSupported(n)) { |
495 |
| - std::stringstream ss; |
496 |
| - ss << *schema; |
497 |
| - unsupported_ops[schema->operator_name()] = ss.str(); |
| 494 | + if (!OpSupported(n)) { |
| 495 | + if (schema){ |
| 496 | + std::stringstream ss; |
| 497 | + ss << *schema; |
| 498 | + unsupported_ops[schema->operator_name()] = ss.str(); |
| 499 | + } else { |
| 500 | + std::stringstream ss; |
| 501 | + ss << util::node_info(n); |
| 502 | + // operator.overload is a filler name just to call the constructor. |
| 503 | + c10::OperatorName op(ss.str(), "operator.overload"); |
| 504 | + unsupported_ops[op] = ss.str(); |
| 505 | + } |
498 | 506 | }
|
| 507 | + |
499 | 508 | for (const auto sub_b : n->blocks()) {
|
500 | 509 | auto sub_b_unsupported_ops = GetUnsupportedOpsInBlock(sub_b);
|
501 | 510 | unsupported_ops.insert(sub_b_unsupported_ops.begin(), sub_b_unsupported_ops.end());
|
@@ -530,7 +539,7 @@ std::set<std::string> ConvertableOpsInBlock(const torch::jit::Block* b) {
|
530 | 539 |
|
531 | 540 | bool VerifyConverterSupportForBlock(const torch::jit::Block* b, bool suppress_errors) {
|
532 | 541 | auto unsupported_ops = GetUnsupportedOpsInBlock(b);
|
533 |
| - |
| 542 | + LOG_DEBUG("======unsupported_ops size ===========: " << unsupported_ops.size()); |
534 | 543 | if (unsupported_ops.size() != 0) {
|
535 | 544 | std::stringstream unsupported_msg;
|
536 | 545 | unsupported_msg
|
|
0 commit comments