Skip to content

Commit

Permalink
Removing legacy from new tests infra (#5846)
Browse files Browse the repository at this point in the history
* Removed old stuff

* Moved more stuff to old helpers

* Rewritten LRN tests

* Removed IRBuild_v6

* Fixed caching tests by changing test function

* Removed Jira tickets
  • Loading branch information
ilya-lavrenov authored May 26, 2021
1 parent 55c73ab commit 5b8b214
Show file tree
Hide file tree
Showing 48 changed files with 682 additions and 1,617 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ file(GLOB_RECURSE legacy_tests
"${CMAKE_CURRENT_SOURCE_DIR}/lp_transformations/*.cpp" # CVS-55376
"${CMAKE_CURRENT_SOURCE_DIR}/ngraph_reader/*.cpp" # CVS-55365
"${CMAKE_CURRENT_SOURCE_DIR}/cnn_network/cnn_ngraph_impl_tests.cpp" # CVS-55375
"${CMAKE_CURRENT_SOURCE_DIR}/core_threading_tests.cpp" # CVS-55257
"${CMAKE_CURRENT_SOURCE_DIR}/caching_test.cpp" # CVS-55257
"${CMAKE_CURRENT_SOURCE_DIR}/local_test.cpp" # CVS-55386
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include <string>

#include "common_test_utils/xml_net_builder/ir_net.hpp"
#include "ngraph_reader_tests.hpp"

// since EinsumDecomposition is applied, disable these two tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,49 @@

#include <string>
#include "ngraph_reader_tests.hpp"
#include "common_test_utils/xml_net_builder/ir_net.hpp"

TEST_F(NGraphReaderTests, ReadGeluNetwork) {
CommonTestUtils::IRBuilder_v10 ir_builder_v10("Network");

auto input_layer = ir_builder_v10
.AddLayer("in1", "Parameter", {{"shape", "1,128"},
{"element_type", "f32"}}).AddOutPort(Precision::ePrecision::FP32, {1, 128})
.getLayer();

auto gelu_layer = ir_builder_v10
.AddLayer("activation", "Gelu", {}, "opset2")
.AddInPort(Precision::ePrecision::FP32, {1, 128})
.AddOutPort(Precision::ePrecision::FP32, {1, 128})
.getLayer();

auto result_layer = ir_builder_v10
.AddLayer("output", "Result")
.AddInPort(Precision::ePrecision::FP32, {1, 128})
.getLayer();

input_layer.out(0).connect(gelu_layer.in(0));
gelu_layer.out(0).connect(result_layer.in(0));
std::string model_v10 = R"V0G0N(
<net name="Network" version="10">
<layers>
<layer id="0" name="in1" type="Parameter" version="opset1">
<data shape="1,128" element_type="f32"/>
<output>
<port id="0" precision="FP32">
<dim>1</dim>
<dim>128</dim>
</port>
</output>
</layer>
<layer id="1" name="activation" type="Gelu" version="opset2">
<input>
<port id="0">
<dim>1</dim>
<dim>128</dim>
</port>
</input>
<output>
<port id="1" precision="FP32">
<dim>1</dim>
<dim>128</dim>
</port>
</output>
</layer>
<layer id="2" name="output" type="Result" version="opset1">
<input>
<port id="0">
<dim>1</dim>
<dim>128</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";

// f(x) = 0.5 * x * (1.0 + erf( x / sqrt(2.0) )
std::string model_v7 = R"V0G0N(
Expand Down Expand Up @@ -132,8 +152,6 @@ TEST_F(NGraphReaderTests, ReadGeluNetwork) {
</net>
)V0G0N";

std::string model_v10 = ir_builder_v10.serialize();

compareIRs(model_v10, model_v7, 0);
}

Expand Down
Loading

0 comments on commit 5b8b214

Please sign in to comment.