Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / src / inference_engine / shape_infer / const_infer / ie_reshape_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 #include <ie_memcpy.h>
14 #include "ie_const_infer_impl.hpp"
15
16 namespace InferenceEngine {
17 namespace ShapeInfer {
18
19 /**
20  *@brief Implementation of Const inference for Tile layer
21  */
22 class ReshapeConstInfer : public ConstInferImpl {
23 public:
24     explicit ReshapeConstInfer(const std::string& type) : ConstInferImpl(type) {}
25
26     void inferImpl(const std::vector<Blob::CPtr>& inData,
27                    const std::map<std::string, std::string>& params,
28                    const std::map<std::string, Blob::Ptr>& blobs,
29                    std::vector<Blob::Ptr>& outData) override {
30         auto inBlob = *inData.begin();
31         const auto* inBuffer = inBlob->cbuffer().as<uint8_t*>();
32         auto outBlob = *outData.begin();
33         auto* outBuffer = outBlob->buffer().as<uint8_t*>();
34         ie_memcpy(outBuffer, outBlob->byteSize(), inBuffer, inBlob->byteSize());
35     }
36 };
37
38 }  // namespace ShapeInfer
39 }  // namespace InferenceEngine