1 // Copyright (C) 2018 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
7 #include <description_buffer.hpp>
8 #include "ie_built_in_impl.hpp"
15 namespace InferenceEngine {
16 namespace ShapeInfer {
19 *@brief Implementation of Shape inference for RoiPooling layer
21 class RoiPoolingShapeProp : public BuiltInShapeInferImpl {
23 explicit RoiPoolingShapeProp(const std::string& type) : BuiltInShapeInferImpl(type) {}
25 void inferShapesImpl(const std::vector<SizeVector>& inShapes,
26 const std::map<std::string, std::string>& params,
27 const std::map<std::string, Blob::Ptr>& blobs,
28 std::vector<SizeVector>& outShapes) override {
30 CNNLayer cnnLayer(lp);
31 cnnLayer.params = params;
32 cnnLayer.type = _type;
33 validate(&cnnLayer, inShapes, params, blobs);
35 int pooled_h = cnnLayer.GetParamAsInt("pooled_h");
36 int pooled_w = cnnLayer.GetParamAsInt("pooled_w");
38 {inShapes[1][0], inShapes[0][1], static_cast<size_t>(pooled_h), static_cast<size_t>(pooled_w)});
42 } // namespace ShapeInfer
43 } // namespace InferenceEngine