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 Concat layer
19 class ConcatShapeProp : public BuiltInShapeInferImpl {
21 explicit ConcatShapeProp(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 ConcatLayer concatLayer(lp);
29 concatLayer.params = params;
30 concatLayer.type = _type;
31 validate(&concatLayer, inBlobs, params, blobs);
34 size_t axis = concatLayer._axis;
35 outShapes.push_back(inShapes[0]);
36 for (const auto& inShape : inShapes) {
37 if (axis >= inShape.size())
38 THROW_IE_EXCEPTION << "Axis can't be more then number of input shapes";
41 outShapes[0][axis] = sum;
45 } // namespace ShapeInfer
46 } // namespace InferenceEngine