1 // Copyright (C) 2018 Intel Corporation
3 // SPDX-License-Identifier: Apache-2.0
8 #include <description_buffer.hpp>
9 #include "ie_built_in_impl.hpp"
10 #include <ie_layers.h>
16 namespace InferenceEngine {
17 namespace ShapeInfer {
20 *@brief Implementation of Shape inference for PSRoiPooling layer
22 class PSRoiPoolingShapeProp : public BuiltInShapeInferImpl {
24 explicit PSRoiPoolingShapeProp(const std::string& type) : BuiltInShapeInferImpl(type) {}
26 void inferShapesImpl(const std::vector<SizeVector>& inShapes,
27 const std::map<std::string, std::string>& params,
28 const std::map<std::string, Blob::Ptr>& blobs,
29 std::vector<SizeVector>& outShapes) override {
31 CNNLayer cnnLayer(lp);
32 cnnLayer.params = params;
33 cnnLayer.type = _type;
34 validate(&cnnLayer, inShapes, params, blobs);
35 size_t output_dim = static_cast<size_t>(cnnLayer.GetParamAsInt("output_dim"));
36 size_t group_size = static_cast<size_t>(cnnLayer.GetParamAsInt("group_size"));
37 outShapes.push_back({inShapes[1][0], output_dim, group_size, group_size});
41 } // namespace ShapeInfer
42 } // namespace InferenceEngine