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 Pad layer
19 class PadShapeProp : public BuiltInShapeInferImpl {
21 explicit PadShapeProp(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 PadLayer padLayer(lp);
29 padLayer.params = params;
30 padLayer.type = _type;
31 validate(&padLayer, inBlobs, params, blobs);
33 outShapes.push_back(inShapes[0]);
34 for (size_t i = 0; i < outShapes[0].size(); i++) {
35 outShapes[0][i] += padLayer.pads_begin[i] + padLayer.pads_end[i];
40 } // namespace ShapeInfer
41 } // namespace InferenceEngine