Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / src / inference_engine / shape_infer / built-in / ie_tile_shape_infer.hpp
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #pragma once
6
7 #include "ie_built_in_impl.hpp"
8 #include <map>
9 #include <memory>
10 #include <string>
11 #include <vector>
12
13 namespace InferenceEngine {
14 namespace ShapeInfer {
15
16 /**
17  *@brief Implementation of Shape inference for Tile layer
18  */
19 class TileShapeProp : public BuiltInShapeInferImpl {
20 public:
21     explicit TileShapeProp(const std::string& type) : BuiltInShapeInferImpl(type) {}
22
23     void inferShapesImpl(const std::vector<Blob::CPtr>& inBlobs,
24                          const std::map<std::string, std::string>& params,
25                          const std::map<std::string, Blob::Ptr>& blobs,
26                          std::vector<SizeVector>& outShapes) override {
27         LayerParams lp{};
28         TileLayer tileLayer(lp);
29         tileLayer.params = params;
30         tileLayer.type = _type;
31         validate(&tileLayer, inBlobs, params, blobs);
32         outShapes.push_back(inShapes[0]);
33         outShapes[0][tileLayer.axis] *= tileLayer.tiles;
34     }
35 };
36
37 }  // namespace ShapeInfer
38 }  // namespace InferenceEngine