Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into ngraph-cnnnetwork
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed May 27, 2021
2 parents e57769b + 5b8b214 commit b506e08
Show file tree
Hide file tree
Showing 54 changed files with 700 additions and 1,621 deletions.
2 changes: 2 additions & 0 deletions .ci/azure/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ jobs:
-DENABLE_PYTHON=ON
-DPYTHON_EXECUTABLE=/usr/bin/python3.6
-DENABLE_TESTS=ON
-DNGRAPH_ONNX_IMPORT_ENABLE=ON
-DNGRAPH_ONNX_EDITOR_ENABLE=ON
-DENABLE_FASTER_BUILD=ON
-DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules
$(REPO_DIR)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ class ClassificationResultT {

const auto result =
moutputHolder
.as<const InferenceEngine::PrecisionTrait<InferenceEngine::Precision::FP32>::value_type*>()[_results[id] +
.as<const InferenceEngine::PrecisionTrait<InferenceEngine::Precision::FP32>::value_type*>()[_results.at(id) +
image_id * (_outBlob->size() / _batchSize)];

std::cout << std::setw(static_cast<int>(_classidStr.length())) << std::left << _results[id] << " ";
std::cout << std::setw(static_cast<int>(_classidStr.length())) << std::left << _results.at(id) << " ";
std::cout << std::left << std::setw(static_cast<int>(_probabilityStr.length())) << std::fixed << result;

if (!_labels.empty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,9 @@ class StageNode :
// Bindings with IE
//

IE_SUPPRESS_DEPRECATED_START
VPU_MODEL_ATTRIBUTE(ie::CNNLayerPtr, origLayer, nullptr)
IE_SUPPRESS_DEPRECATED_END

//
// Edges
Expand Down Expand Up @@ -573,7 +575,9 @@ class StageNode :
//

inline std::string origLayerName() const {
IE_SUPPRESS_DEPRECATED_START
return _origLayer != nullptr ? _origLayer->name : std::string();
IE_SUPPRESS_DEPRECATED_END
}

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

namespace vpu {

IE_SUPPRESS_DEPRECATED_START

class StageBuilder final {
public:
using Ptr = std::shared_ptr<StageBuilder>;
Expand Down Expand Up @@ -359,4 +361,6 @@ class StageBuilder final {
int32_t blankIndex);
};

IE_SUPPRESS_DEPRECATED_END

} // namespace vpu
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 b506e08

Please sign in to comment.