1 // Copyright (C) 2018-2019 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 PriorBoxClustered layer
21 class PriorBoxClusteredShapeProp : public BuiltInShapeInferImpl {
23 explicit PriorBoxClusteredShapeProp(const std::string& type) : BuiltInShapeInferImpl(type) {}
25 void inferShapesImpl(const std::vector<Blob::CPtr>& inBlobs,
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, inBlobs, params, blobs);
34 std::vector<float> widths = cnnLayer.GetParamAsFloats("width", {});
35 size_t res_prod = widths.size() * 4;
36 for (int i = 2; i < inShapes[0].size(); i++)
37 res_prod *= inShapes[0][i];
38 outShapes.push_back({1, 2, res_prod});
42 } // namespace ShapeInfer
43 } // namespace InferenceEngine