Extend MO/nGraph for operation MaxPool-8 (#6776)
* MO update for MaxPool-8 * using attrs in op constructor * remove pads_value attr and pad fusing * added axis and index_element_type parameters * updated mo maxpool-8 * added maxpool-8->maxpool-1 transformation, disabled Pad to MaxPool fusing * added remove_values_output to pooling extractors * moved remove_values_output attribute to pooling infer function * fixed ir_comparator tests * disabled pad to maxpool fusing test * added downgrade transformation test * downgrade transformation update * updated ir reader and tf pooling layer tests * updated onnx pooling layer tests and MO infer unit test * updated ir reader extender * uncommented layer tests code * disabled MaxPool-8 python binding test * comment resolving, removed PadMaxPool fusing * removed test * downgrade transformation fix, MO codestyle changes * removed axis check from downgrade transformation * mark max_pool_test as xfail * updated downgrade transformation test * using OPENVINO_RTTI
This commit is contained in:
@@ -132,6 +132,7 @@ class TestPooling(OnnxRuntimeLayerTest):
|
||||
'rounding_type': 'ceil' if auto_pad != 'NOTSET' or ceil else 'floor',
|
||||
'auto_pad': None},
|
||||
'node_data': {'shape': out_shape, 'kind': 'data'},
|
||||
'node_indicies_data': {'shape': out_shape, 'kind': 'data'},
|
||||
'input_const_data': {'kind': 'data', 'value': constant.flatten()},
|
||||
'const': {'kind': 'op', 'type': 'Const'},
|
||||
'const_data': {'shape': out_shape, 'kind': 'data'},
|
||||
@@ -141,21 +142,24 @@ class TestPooling(OnnxRuntimeLayerTest):
|
||||
}
|
||||
if op == 'AveragePool':
|
||||
nodes_attributes['node']['type'] = 'AvgPool'
|
||||
nodes_attributes['node']['exclude-pad'] = 'true' if count_include_pad == 0 else 'false'
|
||||
nodes_attributes['node']['exclude-pad'] = True if count_include_pad == 0 else False
|
||||
else:
|
||||
nodes_attributes['node']['type'] = 'MaxPool'
|
||||
|
||||
edges = [('input', 'input_data'),
|
||||
('input_data', 'node'),
|
||||
('node', 'node_data', {'out': 0}),
|
||||
('input_const_data', 'const'),
|
||||
('const', 'const_data'),
|
||||
('node_data', 'concat'),
|
||||
('const_data', 'concat'),
|
||||
('concat', 'concat_data'),
|
||||
('concat_data', 'result')]
|
||||
if op == "MaxPool":
|
||||
edges.append(('node', 'node_indicies_data', {'out': 1}))
|
||||
ref_net = build_graph(nodes_attributes,
|
||||
[('input', 'input_data'),
|
||||
('input_data', 'node'),
|
||||
('node', 'node_data'),
|
||||
('input_const_data', 'const'),
|
||||
('const', 'const_data'),
|
||||
('node_data', 'concat'),
|
||||
('const_data', 'concat'),
|
||||
('concat', 'concat_data'),
|
||||
('concat_data', 'result')
|
||||
])
|
||||
edges,
|
||||
nodes_with_edges_only=True)
|
||||
|
||||
return onnx_net, ref_net
|
||||
|
||||
|
||||
@@ -73,7 +73,8 @@ class TestPooling(CommonTFLayerTest):
|
||||
'pooling': {'kernel': kernel_size, 'pads_begin': pads_begin, 'pads_end': pads_end,
|
||||
'strides': strides, 'kind': 'op', 'type': None},
|
||||
'pooling_data': {'shape': out_shape, 'kind': 'data'},
|
||||
'result': {'kind': 'op', 'type': 'Result'}
|
||||
'result': {'kind': 'op', 'type': 'Result'},
|
||||
'pooling_indicies_data': {'kind': 'data', 'shape': out_shape}
|
||||
}
|
||||
|
||||
if method == 'avg':
|
||||
@@ -81,12 +82,17 @@ class TestPooling(CommonTFLayerTest):
|
||||
elif method == 'max':
|
||||
nodes_attributes['pooling']['type'] = 'MaxPool'
|
||||
|
||||
edges = [('input', 'input_data'),
|
||||
('input_data', 'pooling'),
|
||||
('pooling', 'pooling_data', {'out': 0}),
|
||||
('pooling_data', 'result')]
|
||||
|
||||
if method == 'max':
|
||||
edges.append(('pooling', 'pooling_indicies_data', {'out': 1}))
|
||||
|
||||
ref_net = build_graph(nodes_attributes,
|
||||
[('input', 'input_data'),
|
||||
('input_data', 'pooling'),
|
||||
('pooling', 'pooling_data'),
|
||||
('pooling_data', 'result')
|
||||
])
|
||||
edges=edges,
|
||||
nodes_with_edges_only=True)
|
||||
|
||||
return tf_net, ref_net
|
||||
|
||||
|
||||
Reference in New Issue
Block a user