"""
- 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.
import networkx as nx
import numpy as np
-from copy import deepcopy
from extensions.middle.EltwiseInputReshape import EltwiseInputReshape
-from mo.front.common.layout import get_features_dim, shape_for_layout
-from mo.graph.graph import Node
-from mo.middle.passes.fusing.helpers import get_value_id
+from mo.graph.graph import Node, Graph
from mo.middle.replacement import MiddleReplacementPattern
-from mo.ops.op import Op
-from mo.ops.reshape import Reshape
class EltwiseInputNormalize(EltwiseInputReshape, MiddleReplacementPattern):
# This pass should be called directly from pipeline before layout change and other permutations
enabled = False
- def find_and_replace_pattern(self, graph: nx.MultiDiGraph):
+ def find_and_replace_pattern(self, graph: Graph):
eltwise_nodes = [Node(graph, node) for node in graph.node if Node(graph, node).soft_get('type') == 'Eltwise']
# Iterating over all Eltwise operations and check that every input has similar shape
# in case of different shapes, we inserts new_shape attribute and then call EltwiseInputReshape extension