Publishing 2019 R1 content
[platform/upstream/dldt.git] / model-optimizer / extensions / ops / reorgyolo.py
index 51a2c20..e5bb9ac 100644 (file)
@@ -1,5 +1,5 @@
 """
- 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 mo.graph.graph import Node
+from mo.graph.graph import Node, Graph
 from mo.ops.op import Op, PermuteAttrs
 
 
 class ReorgYoloOp(Op):
     op = 'ReorgYolo'
 
-    def __init__(self, graph: nx.MultiDiGraph, attrs: dict):
+    def __init__(self, graph: Graph, attrs: dict):
         mandatory_props = {
             'type': __class__.op,
             'op': __class__.op,
@@ -46,10 +46,10 @@ class ReorgYoloOp(Op):
         stride = node.stride
 
         output_shape = np.full_like(input_shape, -1, dtype=np.int64)
-        output_shape[node.batch_dims] = input_shape[node.batch_dims]
-        output_shape[node.channel_dims] = input_shape[node.channel_dims] * stride ** 2
+        output_shape[node.batch_dims] = input_shape[node.batch_dims]  # pylint: disable=unsupported-assignment-operation
+        output_shape[node.channel_dims] = input_shape[node.channel_dims] * stride ** 2  # pylint: disable=unsupported-assignment-operation
         # Round as in caffe
-        output_shape[node.spatial_dims] = np.round(input_shape[node.spatial_dims] / stride)
+        output_shape[node.spatial_dims] = np.round(input_shape[node.spatial_dims] / stride)  # pylint: disable=unsupported-assignment-operation
 
         node.out_node().shape = output_shape
         PermuteAttrs.create_permute_attrs(node, attrs=[('channel_dims', 'input:0'), ('spatial_dims', 'input:0')])