Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / src / inference_engine / shape_infer / const_infer / ie_const_const_infer.hpp
1 // Copyright (C) 2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #pragma once
6
7 #include <ie_blob.h>
8 #include <map>
9 #include <memory>
10 #include <string>
11 #include <vector>
12 #include <ie_layers.h>
13
14 namespace InferenceEngine {
15 namespace ShapeInfer {
16
17 /**
18  *@brief Implementation of Const inference for TBD layer
19  */
20 class ConstConstInfer : public ConstInferImpl {
21 public:
22     explicit ConstConstInfer(const std::string& type) : ConstInferImpl(type) {}
23
24     void inferImpl(const std::vector<Blob::CPtr>& inData,
25                const std::map<std::string, std::string>& params,
26                const std::map<std::string, Blob::Ptr>& blobs,
27                std::vector<Blob::Ptr>& outData) override {
28         auto it = blobs.find("custom");
29         if (it == blobs.end()) THROW_IE_EXCEPTION << "Missed `custom` blob";
30         // TODO: copy instead of putting pointer?
31         outData[0] = (*it).second;
32     }
33 };
34
35 }  // namespace ShapeInfer
36 }  // namespace InferenceEngine