Returns a string containing a table listing all rejected nodes. The table looks something like this: ╒══════════════════════════╤══════════════════════════╤═════════════════════════════════════╤═════════════════════════════════════╕ │ Node name │ Target
(self)
| 614 | self._rejected_nodes[node] = reason |
| 615 | |
| 616 | def get_table_report(self) -> str: |
| 617 | """Returns a string containing a table listing all rejected nodes. |
| 618 | The table looks something like this: |
| 619 | ╒══════════════════════════╤══════════════════════════╤═════════════════════════════════════╤═════════════════════════════════════╕ |
| 620 | │ Node name │ Target │ Torch func │ Reason │ |
| 621 | ╞══════════════════════════╪══════════════════════════╪═════════════════════════════════════╪═════════════════════════════════════╡ |
| 622 | │ aten_convolution_default │ aten.convolution.default │ ('conv2d_1', 'builtin_function_or_m │ Convolution needs to have │ |
| 623 | │ │ │ ethod.conv2d') │ kernel_y<=64, │ |
| 624 | │ │ │ │ kernel_x*kernel_y<=4096, got kernel │ |
| 625 | │ │ │ │ (2, 65) │ |
| 626 | ╘══════════════════════════╧══════════════════════════╧═════════════════════════════════════╧═════════════════════════════════════╛ |
| 627 | """ |
| 628 | reject_report = [] |
| 629 | for node in self._rejected_nodes: |
| 630 | if node.op == "placeholder" or node.op == "output": |
| 631 | continue |
| 632 | if not (target := getattr(node.target, "_op", None)): |
| 633 | target = node.target |
| 634 | torch_fn = node.meta.get("torch_fn", "-") |
| 635 | reject_report.append( |
| 636 | [node.name, target, torch_fn, self._rejected_nodes[node]] |
| 637 | ) |
| 638 | if len(reject_report) > 0: |
| 639 | return tabulate( |
| 640 | reject_report, |
| 641 | ["Node name", "Target", "Torch func", "Reason"], |
| 642 | tablefmt="fancy_grid", |
| 643 | maxcolwidths=35, |
| 644 | ) |
| 645 | else: |
| 646 | return "No nodes rejected." |
| 647 | |
| 648 | def wrap_check( |
| 649 | self, operator_support: OperatorSupportBase, message: str |