Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / src / inference_engine / shape_infer / built-in / ie_inner_product_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 <description_buffer.hpp>
8 #include "ie_built_in_impl.hpp"
9 #include "debug.h"
10 #include <map>
11 #include <memory>
12 #include <string>
13 #include <vector>
14
15 namespace InferenceEngine {
16 namespace ShapeInfer {
17
18 class InnerProductShapeProp : public BuiltInShapeInferImpl {
19 public:
20     explicit InnerProductShapeProp(const std::string& type) : BuiltInShapeInferImpl(type) {}
21
22     void inferShapesImpl(const std::vector<Blob::CPtr>& inBlobs,
23                          const std::map<std::string, std::string>& params,
24                          const std::map<std::string, Blob::Ptr>& blobs,
25                          std::vector<SizeVector>& outShapes) override {
26         LayerParams lp{};
27         FullyConnectedLayer fcLayer(lp);
28         fcLayer.params = params;
29         fcLayer.type = _type;
30         validate(&fcLayer, inBlobs, params, blobs);
31         size_t OC, ON;
32         ON = inShapes[0][0];
33         OC = fcLayer._out_num;
34         outShapes.emplace_back(std::initializer_list<size_t>{ON, OC});
35     }
36 };
37
38 }  // namespace ShapeInfer
39 }  // namespace InferenceEngine