add tests for 5 ops based on model zoo (#3062)
authorBartek Szmelczynski <bartosz.szmelczynski@intel.com>
Mon, 16 Nov 2020 12:19:31 +0000 (13:19 +0100)
committerGitHub <noreply@github.com>
Mon, 16 Nov 2020 12:19:31 +0000 (15:19 +0300)
* add tests for 5 ops based on model zoo

* remove unnecessary layers from the test

* add test case with merge_repeated=0

* remove unnecessary layers and add new test casae with do_softmax=0

* remove unnecessary layers from the test

inference-engine/tests/functional/inference_engine/ngraph_reader/binary_convolution_tests.cpp [new file with mode: 0644]
inference-engine/tests/functional/inference_engine/ngraph_reader/ctc_greedy_decoder_tests.cpp [new file with mode: 0644]
inference-engine/tests/functional/inference_engine/ngraph_reader/group_convolution_tests.cpp [new file with mode: 0644]
inference-engine/tests/functional/inference_engine/ngraph_reader/region_yolo_tests.cpp [new file with mode: 0644]
inference-engine/tests/functional/inference_engine/ngraph_reader/reorg_yolo_tests.cpp [new file with mode: 0644]

diff --git a/inference-engine/tests/functional/inference_engine/ngraph_reader/binary_convolution_tests.cpp b/inference-engine/tests/functional/inference_engine/ngraph_reader/binary_convolution_tests.cpp
new file mode 100644 (file)
index 0000000..abd74e3
--- /dev/null
@@ -0,0 +1,120 @@
+// Copyright (C) 2018-2020 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#include <string>
+#include "ngraph_reader_tests.hpp"
+
+TEST_F(NGraphReaderTests, ReadBinaryConvolutionNetwork) {
+    std::string model = R"V0G0N(
+<net name="model_bin" version="10">
+       <layers>
+               <layer id="0" name="612/placeholder_port_0" type="Parameter" version="opset1">
+                       <data shape="1,64,28,28" element_type="f32"/>
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>64</dim>
+                                       <dim>28</dim>
+                                       <dim>28</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="1" name="626/Output_0/Data__const" type="Const" version="opset1">
+                       <data offset="264" size="512" shape="64,64,1,1" element_type="u1"/>
+                       <output>
+                               <port id="0" precision="U1">
+                                       <dim>64</dim>
+                                       <dim>64</dim>
+                                       <dim>1</dim>
+                                       <dim>1</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="2" name="627" type="BinaryConvolution" version="opset1">
+                       <data strides="1,1" dilations="1,1" pads_begin="0,0" pads_end="0,0" output_padding="0,0" pad_value="-1.0" mode="xnor-popcount"/>
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>64</dim>
+                                       <dim>28</dim>
+                                       <dim>28</dim>
+                               </port>
+                               <port id="1">
+                                       <dim>64</dim>
+                                       <dim>64</dim>
+                                       <dim>1</dim>
+                                       <dim>1</dim>
+                               </port>
+                       </input>
+                       <output>
+                               <port id="2" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>64</dim>
+                                       <dim>28</dim>
+                                       <dim>28</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="3" name="627/sink_port_0" type="Result" version="opset1">
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>64</dim>
+                                       <dim>28</dim>
+                                       <dim>28</dim>
+                               </port>
+                       </input>
+               </layer>
+       </layers>
+       <edges>
+               <edge from-layer="0" from-port="0" to-layer="2" to-port="0"/>
+               <edge from-layer="1" from-port="0" to-layer="2" to-port="1"/>
+               <edge from-layer="2" from-port="2" to-layer="3" to-port="0"/>
+       </edges>
+</net>
+)V0G0N";
+    std::string modelV7 = R"V0G0N(
+<net name="model_bin" version="7">
+       <layers>
+               <layer id="0" name="612/placeholder_port_0" type="Input" version="opset1">
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>64</dim>
+                                       <dim>28</dim>
+                                       <dim>28</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="1" name="627" type="BinaryConvolution" version="opset1">
+                       <data group="1" strides="1,1" dilations="1,1" kernel="1,1" pads_begin="0,0" pads_end="0,0" output="64" pad_value="-1.0" mode="xnor-popcount" input="64"/>
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>64</dim>
+                                       <dim>28</dim>
+                                       <dim>28</dim>
+                               </port>
+                       </input>
+                       <output>
+                               <port id="2" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>64</dim>
+                                       <dim>28</dim>
+                                       <dim>28</dim>
+                               </port>
+                       </output>
+                       <blobs>
+                               <weights offset="264" size="512" precision="U8"/>
+                       </blobs>
+               </layer>
+       </layers>
+       <edges>
+               <edge from-layer="0" from-port="0" to-layer="1" to-port="0"/>
+
+       </edges>
+</net>
+)V0G0N";
+    compareIRs(model, modelV7, 1288);
+}
diff --git a/inference-engine/tests/functional/inference_engine/ngraph_reader/ctc_greedy_decoder_tests.cpp b/inference-engine/tests/functional/inference_engine/ngraph_reader/ctc_greedy_decoder_tests.cpp
new file mode 100644 (file)
index 0000000..d8188da
--- /dev/null
@@ -0,0 +1,246 @@
+// Copyright (C) 2018-2020 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#include <string>
+#include "ngraph_reader_tests.hpp"
+
+TEST_F(NGraphReaderTests, ReadCTCGreedyDecoderNetwork) {
+    std::string model = R"V0G0N(
+<net name="ctcgreedydecoder" version="10">
+       <layers>
+               <layer id="0" name="CTCGreedyDecoder/placeholder_port_0" type="Parameter" version="opset1">
+                       <data shape="20,8,128" element_type="f32"/>
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                                       <dim>128</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="1" name="Fill/Broadcast/Output_0/Data__const" type="Const" version="opset1">
+                       <data offset="0" size="640" shape="20,8" element_type="f32"/>
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="2" name="CTCGreedyDecoder" type="CTCGreedyDecoder" version="opset1">
+                       <data ctc_merge_repeated="1"/>
+                       <input>
+                               <port id="0">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                                       <dim>128</dim>
+                               </port>
+                               <port id="1">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                               </port>
+                       </input>
+                       <output>
+                               <port id="2" precision="FP32">
+                                       <dim>8</dim>
+                                       <dim>20</dim>
+                                       <dim>1</dim>
+                                       <dim>1</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="3" name="CTCGreedyDecoder/sink_port_0" type="Result" version="opset1">
+                       <input>
+                               <port id="0">
+                                       <dim>8</dim>
+                                       <dim>20</dim>
+                                       <dim>1</dim>
+                                       <dim>1</dim>
+                               </port>
+                       </input>
+               </layer>
+       </layers>
+       <edges>
+               <edge from-layer="0" from-port="0" to-layer="2" to-port="0"/>
+               <edge from-layer="1" from-port="0" to-layer="2" to-port="1"/>
+               <edge from-layer="2" from-port="2" to-layer="3" to-port="0"/>
+       </edges>
+</net>
+)V0G0N";
+    std::string modelV7 = R"V0G0N(
+<net name="ctcgreedydecoder" version="7">
+       <layers>
+               <layer id="0" name="CTCGreedyDecoder/placeholder_port_0" type="Input" version="opset1">
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                                       <dim>128</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="1" name="Fill/Broadcast/Output_0/Data__const" type="Const" version="opset1">
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                               </port>
+                       </output>
+                       <blobs>
+                               <custom offset="0" size="640" precision="FP32"/>
+                       </blobs>
+               </layer>
+               <layer id="2" name="CTCGreedyDecoder" type="CTCGreedyDecoder" version="opset1">
+                       <data ctc_merge_repeated="1"/>
+                       <input>
+                               <port id="0">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                                       <dim>128</dim>
+                               </port>
+                               <port id="1">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                               </port>
+                       </input>
+                       <output>
+                               <port id="2" precision="FP32">
+                                       <dim>8</dim>
+                                       <dim>20</dim>
+                                       <dim>1</dim>
+                                       <dim>1</dim>
+                               </port>
+                       </output>
+               </layer>
+       </layers>
+       <edges>
+               <edge from-layer="0" from-port="0" to-layer="2" to-port="0"/>
+               <edge from-layer="1" from-port="0" to-layer="2" to-port="1"/>
+       </edges>
+</net>
+)V0G0N";
+    compareIRs(model, modelV7, 640);
+}
+
+
+#include <string>
+#include "ngraph_reader_tests.hpp"
+
+TEST_F(NGraphReaderTests, ReadCTCGreedyDecoderNoMergeNetwork) {
+    std::string model = R"V0G0N(
+<net name="ctcgreedydecoder" version="10">
+       <layers>
+               <layer id="0" name="CTCGreedyDecoder/placeholder_port_0" type="Parameter" version="opset1">
+                       <data shape="20,8,128" element_type="f32"/>
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                                       <dim>128</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="1" name="Fill/Broadcast/Output_0/Data__const" type="Const" version="opset1">
+                       <data offset="0" size="640" shape="20,8" element_type="f32"/>
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="2" name="CTCGreedyDecoder" type="CTCGreedyDecoder" version="opset1">
+                       <data ctc_merge_repeated="0"/>
+                       <input>
+                               <port id="0">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                                       <dim>128</dim>
+                               </port>
+                               <port id="1">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                               </port>
+                       </input>
+                       <output>
+                               <port id="2" precision="FP32">
+                                       <dim>8</dim>
+                                       <dim>20</dim>
+                                       <dim>1</dim>
+                                       <dim>1</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="3" name="CTCGreedyDecoder/sink_port_0" type="Result" version="opset1">
+                       <input>
+                               <port id="0">
+                                       <dim>8</dim>
+                                       <dim>20</dim>
+                                       <dim>1</dim>
+                                       <dim>1</dim>
+                               </port>
+                       </input>
+               </layer>
+       </layers>
+       <edges>
+               <edge from-layer="0" from-port="0" to-layer="2" to-port="0"/>
+               <edge from-layer="1" from-port="0" to-layer="2" to-port="1"/>
+               <edge from-layer="2" from-port="2" to-layer="3" to-port="0"/>
+       </edges>
+</net>
+)V0G0N";
+    std::string modelV7 = R"V0G0N(
+<net name="ctcgreedydecoder" version="7">
+       <layers>
+               <layer id="0" name="CTCGreedyDecoder/placeholder_port_0" type="Input" version="opset1">
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                                       <dim>128</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="1" name="Fill/Broadcast/Output_0/Data__const" type="Const" version="opset1">
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                               </port>
+                       </output>
+                       <blobs>
+                               <custom offset="0" size="640" precision="FP32"/>
+                       </blobs>
+               </layer>
+               <layer id="2" name="CTCGreedyDecoder" type="CTCGreedyDecoder" version="opset1">
+                       <data ctc_merge_repeated="0"/>
+                       <input>
+                               <port id="0">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                                       <dim>128</dim>
+                               </port>
+                               <port id="1">
+                                       <dim>20</dim>
+                                       <dim>8</dim>
+                               </port>
+                       </input>
+                       <output>
+                               <port id="2" precision="FP32">
+                                       <dim>8</dim>
+                                       <dim>20</dim>
+                                       <dim>1</dim>
+                                       <dim>1</dim>
+                               </port>
+                       </output>
+               </layer>
+       </layers>
+       <edges>
+               <edge from-layer="0" from-port="0" to-layer="2" to-port="0"/>
+               <edge from-layer="1" from-port="0" to-layer="2" to-port="1"/>
+       </edges>
+</net>
+)V0G0N";
+    compareIRs(model, modelV7, 640);
+}
diff --git a/inference-engine/tests/functional/inference_engine/ngraph_reader/group_convolution_tests.cpp b/inference-engine/tests/functional/inference_engine/ngraph_reader/group_convolution_tests.cpp
new file mode 100644 (file)
index 0000000..4d89abc
--- /dev/null
@@ -0,0 +1,122 @@
+// Copyright (C) 2018-2020 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#include <string>
+#include "ngraph_reader_tests.hpp"
+
+TEST_F(NGraphReaderTests, ReadGroupConvolutionNetwork) {
+    std::string model = R"V0G0N(
+<net name="GroupConvolution" version="10">
+       <layers>
+               <layer id="0" name="in1" type="Parameter" version="opset1">
+                       <data shape="1,64,65,51" element_type="f32"/>
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>64</dim>
+                                       <dim>65</dim>
+                                       <dim>51</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="1" name="const_val" type="Const" version="opset1">
+                       <data offset="0" size="2304" shape="64,1,1,3,3" element_type="f32"/>
+                       <output>
+                               <port id="1" precision="FP32">
+                                       <dim>64</dim>
+                                       <dim>1</dim>
+                                       <dim>1</dim>
+                                       <dim>3</dim>
+                                       <dim>3</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="2" name="GroupConvolutionOp" type="GroupConvolution" version="opset1">
+                       <data strides="1,1" dilations="1,1" pads_begin="1,1" pads_end="1,1" output_padding="0,0"/>
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>64</dim>
+                                       <dim>65</dim>
+                                       <dim>51</dim>
+                               </port>
+                               <port id="1">
+                                       <dim>64</dim>
+                                       <dim>1</dim>
+                                       <dim>1</dim>
+                                       <dim>3</dim>
+                                       <dim>3</dim>
+                               </port>
+                       </input>
+                       <output>
+                               <port id="2" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>64</dim>
+                                       <dim>65</dim>
+                                       <dim>51</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="3" name="140/sink_port_0" type="Result" version="opset1">
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>64</dim>
+                                       <dim>65</dim>
+                                       <dim>51</dim>
+                               </port>
+                       </input>
+               </layer>
+       </layers>
+       <edges>
+               <edge from-layer="0" from-port="0" to-layer="2" to-port="0"/>
+               <edge from-layer="1" from-port="1" to-layer="2" to-port="1"/>
+               <edge from-layer="2" from-port="2" to-layer="3" to-port="0"/>
+       </edges>
+</net>
+)V0G0N";
+    std::string modelV7 = R"V0G0N(
+<net name="GroupConvolution" version="7">
+       <layers>
+               <layer id="0" name="in1" type="Input" version="opset1">
+                       <data shape="1,64,65,51" element_type="f32"/>
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>64</dim>
+                                       <dim>65</dim>
+                                       <dim>51</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="1" name="GroupConvolutionOp" type="Convolution" version="opset1">
+                       <data group="64" strides="1,1" dilations="1,1" kernel="3,3" pads_begin="1,1" pads_end="1,1" output="64"/>
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>64</dim>
+                                       <dim>65</dim>
+                                       <dim>51</dim>
+                               </port>
+                       </input>
+                       <output>
+                               <port id="2" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>64</dim>
+                                       <dim>65</dim>
+                                       <dim>51</dim>
+                               </port>
+                       </output>
+                       <blobs>
+                               <weights offset="0" size="2304" precision="FP32"/>
+                       </blobs>
+               </layer>
+       </layers>
+       <edges>
+               <edge from-layer="0" from-port="0" to-layer="1" to-port="0"/>
+       </edges>
+</net>
+)V0G0N";
+    compareIRs(model, modelV7, 2304);
+}
diff --git a/inference-engine/tests/functional/inference_engine/ngraph_reader/region_yolo_tests.cpp b/inference-engine/tests/functional/inference_engine/ngraph_reader/region_yolo_tests.cpp
new file mode 100644 (file)
index 0000000..bcdce5d
--- /dev/null
@@ -0,0 +1,185 @@
+// Copyright (C) 2018-2020 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#include <string>
+#include "ngraph_reader_tests.hpp"
+
+TEST_F(NGraphReaderTests, ReadRegionYoloNetwork) {
+    std::string model = R"V0G0N(
+<net name="frozen_graph" version="10">
+       <layers>
+               <layer id="0" name="yolo_out_postprocess/placeholder_port_0" type="Parameter" version="opset1">
+                       <data element_type="f32" shape="1,125,13,13"/>
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>125</dim>
+                                       <dim>13</dim>
+                                       <dim>13</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="1" name="yolo_out_postprocess/YoloRegion" type="RegionYolo" version="opset1">
+                       <data coords="4" mask="0" classes="20" num="5" axis="1" end_axis="3" do_softmax="1" anchors="1.3221,1.73145,3.19275,4.00944,5.05587,8.09892,9.47112,4.84053,11.2364,10.0071"/>
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>125</dim>
+                                       <dim>13</dim>
+                                       <dim>13</dim>
+                               </port>
+                       </input>
+                       <output>
+                               <port id="1" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>21125</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="2" name="364" type="Result" version="opset1">
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>21125</dim>
+                               </port>
+                       </input>
+               </layer>
+       </layers>
+       <edges>
+               <edge from-layer="0" from-port="0" to-layer="1" to-port="0"/>
+               <edge from-layer="1" from-port="1" to-layer="2" to-port="0"/>
+       </edges>
+</net>
+)V0G0N";
+    std::string modelV7 = R"V0G0N(
+<net name="frozen_graph" version="7">
+       <layers>
+               <layer id="0" name="yolo_out_postprocess/placeholder_port_0" type="Input" version="opset1">
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>125</dim>
+                                       <dim>13</dim>
+                                       <dim>13</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="1" name="yolo_out_postprocess/YoloRegion" type="RegionYolo" version="opset1">
+                       <data coords="4" classes="20" num="5" axis="1" end_axis="3" do_softmax="1" mask="0" anchors="1.3221,1.73145,3.19275,4.00944,5.05587,8.09892,9.47112,4.84053,11.2364,10.0071"/>
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>125</dim>
+                                       <dim>13</dim>
+                                       <dim>13</dim>
+                               </port>
+                       </input>
+                       <output>
+                               <port id="1" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>21125</dim>
+                               </port>
+                       </output>
+               </layer>
+       </layers>
+       <edges>
+               <edge from-layer="0" from-port="0" to-layer="1" to-port="0"/>
+       </edges>
+</net>
+)V0G0N";
+    compareIRs(model, modelV7, 4);
+}
+
+
+TEST_F(NGraphReaderTests, ReadRegionYoloMaskNetwork) {
+    std::string model = R"V0G0N(
+<net name="frozen_graph" version="10">
+       <layers>
+               <layer id="0" name="yolo_out_postprocess/placeholder_port_0" type="Parameter" version="opset1">
+                       <data element_type="f32" shape="1,255,26,26"/>
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>255</dim>
+                                       <dim>26</dim>
+                                       <dim>26</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="1" name="yolo_out_postprocess/YoloRegion" type="RegionYolo" version="opset1">
+                       <data anchors="10,14,23,27,37,58,81,82,135,169,344,319" axis="1" classes="80" coords="4" do_softmax="0" end_axis="3" mask="0,1,2" num="6"/>
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>255</dim>
+                                       <dim>26</dim>
+                                       <dim>26</dim>
+                               </port>
+                       </input>
+                       <output>
+                               <port id="1" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>255</dim>
+                                       <dim>26</dim>
+                                       <dim>26</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="2" name="364" type="Result" version="opset1">
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>255</dim>
+                                       <dim>26</dim>
+                                       <dim>26</dim>
+                               </port>
+                       </input>
+               </layer>
+       </layers>
+       <edges>
+               <edge from-layer="0" from-port="0" to-layer="1" to-port="0"/>
+               <edge from-layer="1" from-port="1" to-layer="2" to-port="0"/>
+       </edges>
+</net>
+)V0G0N";
+    std::string modelV7 = R"V0G0N(
+<net name="frozen_graph" version="7">
+       <layers>
+               <layer id="0" name="yolo_out_postprocess/placeholder_port_0" type="Input" version="opset1">
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>255</dim>
+                                       <dim>26</dim>
+                                       <dim>26</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="1" name="yolo_out_postprocess/YoloRegion" type="RegionYolo" version="opset1">
+                   <data anchors="10,14,23,27,37,58,81,82,135,169,344,319" axis="1" classes="80" coords="4" do_softmax="0" end_axis="3" mask="0,1,2" num="6"/>
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>255</dim>
+                                       <dim>26</dim>
+                                       <dim>26</dim>
+                               </port>
+                       </input>
+                       <output>
+                               <port id="1" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>255</dim>
+                                       <dim>26</dim>
+                                       <dim>26</dim>>
+                               </port>
+                       </output>
+               </layer>
+       </layers>
+       <edges>
+               <edge from-layer="0" from-port="0" to-layer="1" to-port="0"/>
+       </edges>
+</net>
+)V0G0N";
+    compareIRs(model, modelV7, 4);
+}
diff --git a/inference-engine/tests/functional/inference_engine/ngraph_reader/reorg_yolo_tests.cpp b/inference-engine/tests/functional/inference_engine/ngraph_reader/reorg_yolo_tests.cpp
new file mode 100644 (file)
index 0000000..f21705c
--- /dev/null
@@ -0,0 +1,98 @@
+// Copyright (C) 2018-2020 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#include <string>
+#include "ngraph_reader_tests.hpp"
+
+TEST_F(NGraphReaderTests, ReadReorgYoloNetwork) {
+    std::string model = R"V0G0N(
+<net name="frozen_graph" version="10">
+       <layers>
+               <layer id="0" name="yolov2/yolov2_feature/lower_features/downsample/placeholder_port_0" type="Parameter" version="opset1">
+                       <data shape="1,26,64,26" element_type="f32"/>
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>26</dim>
+                                       <dim>64</dim>
+                                       <dim>26</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="1" name="yolov2/yolov2_feature/lower_features/downsample" type="ReorgYolo" version="opset2">
+                       <data stride="2"/>
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>26</dim>
+                                       <dim>64</dim>
+                                       <dim>26</dim>
+                               </port>
+                       </input>
+                       <output>
+                               <port id="1" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>104</dim>
+                                       <dim>32</dim>
+                                       <dim>13</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="2" name="365" type="Result" version="opset1">
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>104</dim>
+                                       <dim>32</dim>
+                                       <dim>13</dim>
+                               </port>
+                       </input>
+               </layer>
+       </layers>
+       <edges>
+               <edge from-layer="0" from-port="0" to-layer="1" to-port="0"/>
+               <edge from-layer="1" from-port="1" to-layer="2" to-port="0"/>
+       </edges>
+</net>
+)V0G0N";
+    std::string modelV7 = R"V0G0N(
+<net name="frozen_graph" version="7">
+       <layers>
+               <layer id="0" name="yolov2/yolov2_feature/lower_features/downsample/placeholder_port_0" type="Input" version="opset1">
+                       <output>
+                               <port id="0" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>26</dim>
+                                       <dim>64</dim>
+                                       <dim>26</dim>
+                               </port>
+                       </output>
+               </layer>
+               <layer id="1" name="yolov2/yolov2_feature/lower_features/downsample" type="ReorgYolo" version="opset2">
+                       <data stride="2"/>
+                       <input>
+                               <port id="0">
+                                       <dim>1</dim>
+                                       <dim>26</dim>
+                                       <dim>64</dim>
+                                       <dim>26</dim>
+                               </port>
+                       </input>
+                       <output>
+                               <port id="1" precision="FP32">
+                                       <dim>1</dim>
+                                       <dim>104</dim>
+                                       <dim>32</dim>
+                                       <dim>13</dim>
+                               </port>
+                       </output>
+               </layer>
+       </layers>
+       <edges>
+               <edge from-layer="0" from-port="0" to-layer="1" to-port="0"/>
+       </edges>
+</net>
+)V0G0N";
+    compareIRs(model, modelV7);
+}