summaryrefslogtreecommitdiff
path: root/inference-engine/tests/helpers/ir_gen_helper.cpp
diff options
context:
space:
mode:
authorAlexey Suhov <asuhov@users.noreply.github.com>2019-01-21 21:31:31 +0300
committeropenvino-pushbot <44090433+openvino-pushbot@users.noreply.github.com>2019-01-21 21:31:31 +0300
commit9de27f16bc8b712a5b8c99d1d4b4a66c9144942d (patch)
tree01a383efe94d92b9870d513c2c5ea5d15b07010a /inference-engine/tests/helpers/ir_gen_helper.cpp
parentfbc7a4a710c24def8ab199926a7da90a0394b87d (diff)
downloaddldt-9de27f16bc8b712a5b8c99d1d4b4a66c9144942d.tar.gz
dldt-9de27f16bc8b712a5b8c99d1d4b4a66c9144942d.tar.bz2
dldt-9de27f16bc8b712a5b8c99d1d4b4a66c9144942d.zip
Publishing R5 content (#72)
* Publishing R5 content * Updated ade revision * updated readme * add possibility to build CPU plugin with Intel MKL package
Diffstat (limited to 'inference-engine/tests/helpers/ir_gen_helper.cpp')
-rw-r--r--inference-engine/tests/helpers/ir_gen_helper.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/inference-engine/tests/helpers/ir_gen_helper.cpp b/inference-engine/tests/helpers/ir_gen_helper.cpp
new file mode 100644
index 000000000..40a05c451
--- /dev/null
+++ b/inference-engine/tests/helpers/ir_gen_helper.cpp
@@ -0,0 +1,48 @@
+// Copyright (C) 2018 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#include "ir_gen_helper.hpp"
+
+namespace single_layer_tests {
+
+ std::string IRTemplateGenerator::getIRTemplate(const std::string& name,
+ const std::vector<size_t>& input_shape,
+ const std::string& precision,
+ const std::string& layers,
+ const std::string& edges,
+ const unsigned ir_version) {
+ std::string model = model_t;
+ REPLACE_WITH_STR(model, "_NAME_", name);
+ REPLACE_WITH_NUM(model, "_IRv_", ir_version);
+ REPLACE_WITH_STR(model, "_PR_", precision);
+
+ std::string s_dims;
+ for (auto& dim : input_shape) {
+ s_dims += "\n <dim>";
+ s_dims += std::to_string(dim) + "</dim>";
+ }
+ REPLACE_WITH_STR(model, "__SRC_DIMS__", s_dims);
+ REPLACE_WITH_STR(model, "_LAYERS_", layers);
+ REPLACE_WITH_STR(model, "_EDGES_", edges);
+
+ return model;
+ }
+
+ std::string IRTemplateGenerator::model_t = R"V0G0N(
+ <net name="_NAME_" version="_IRv_" precision="_PR_" batch="1">
+ <layers>
+ <layer name="in1" type="Input" precision="_PR_" id="0">
+ <output>
+ <port id="0">__SRC_DIMS__
+ </port>
+ </output>
+ </layer>
+ _LAYERS_
+ </layers>
+ <edges>
+ _EDGES_
+ </edges>
+ </net>
+ )V0G0N";
+} \ No newline at end of file