Files
openvino/model-optimizer/mo/utils/unsupported_ops.py
Alexey Suhov 6478f1742a Align copyright notice in python scripts (CVS-51320) (#4974)
* Align copyright notice in python scripts (CVS-51320)
2021-03-26 17:54:28 +03:00

28 lines
895 B
Python

# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import collections
from mo.graph.graph import Node, Graph
class UnsupportedOps(object):
def __init__(self, graph: Graph):
self.graph = graph
# map op to a list of node names
self.unsupported = collections.defaultdict(list)
def add(self, node: Node):
op = node.op if node.has_valid('op') else '<UNKNOWN OP>'
name = node.name if node.has_valid('name') else '<UNKNOWN NAME>'
self.unsupported[op].append(name)
def report(self, reporter, header=None):
if len(self.unsupported) > 0:
if header:
reporter(header)
for k, v in self.unsupported.items():
reporter(' ' * 4 + str(k) + ' (' + str(len(v)) + ')')
for node_name in v:
reporter(' ' * 8 + node_name)