1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
7 #include "ie_built_in_impl.hpp"
13 namespace InferenceEngine {
14 namespace ShapeInfer {
17 *@brief Implementation of Shape inference for Proposal layer
19 class ProposalShapeProp : public BuiltInShapeInferImpl {
21 explicit ProposalShapeProp(const std::string& type) : BuiltInShapeInferImpl(type) {}
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 {
28 CNNLayer cnnLayer(lp);
29 cnnLayer.params = params;
30 cnnLayer.type = _type;
31 validate(&cnnLayer, inBlobs, params, blobs);
32 size_t post_nms_topn = static_cast<size_t>(cnnLayer.GetParamAsInt("post_nms_topn"));
33 outShapes.push_back({inShapes[0][0] * post_nms_topn, 5});
37 } // namespace ShapeInfer
38 } // namespace InferenceEngine