"""
- Copyright (c) 2018 Intel Corporation
+ Copyright (c) 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
limitations under the License.
"""
-import networkx as nx
-
from mo.front.common.replacement import FrontReplacementOp
-from mo.graph.graph import Node, insert_node_after
+from mo.graph.graph import Node, Graph
from mo.ops.squeeze import Squeeze
op = "Unpack"
enabled = True
- def nodes_to_remove(self, graph: nx.MultiDiGraph, match: dict):
+ def nodes_to_remove(self, graph: Graph, match: dict):
# do not remove matched node
return []
- def replace_op(self, graph: nx.MultiDiGraph, node: Node):
+ def replace_op(self, graph: Graph, node: Node):
for ind in range(len(node.out_nodes())):
squeeze_node = Squeeze(graph, dict(squeeze_dims=[node.axis], name=node.name + '/Squeeze_')).create_node([])
- insert_node_after(node, squeeze_node, ind)
+ node.insert_node_after(squeeze_node, ind)
# do not replace any output edge
return []