1 // Copyright (C) 2018 Intel Corporation
3 // SPDX-License-Identifier: Apache-2.0
8 #include "ie_built_in_impl.hpp"
14 namespace InferenceEngine {
15 namespace ShapeInfer {
18 *@brief Implementation of Shape inference for Concat layer
20 class ConcatShapeProp : public BuiltInShapeInferImpl {
22 explicit ConcatShapeProp(const std::string& type) : BuiltInShapeInferImpl(type) {}
24 void inferShapesImpl(const std::vector<SizeVector>& inShapes,
25 const std::map<std::string, std::string>& params,
26 const std::map<std::string, Blob::Ptr>& blobs,
27 std::vector<SizeVector>& outShapes) override {
29 ConcatLayer concatLayer(lp);
30 concatLayer.params = params;
31 concatLayer.type = _type;
32 validate(&concatLayer, inShapes, params, blobs);
35 size_t axis = concatLayer._axis;
36 outShapes.push_back(inShapes[0]);
37 for (const auto& inShape : inShapes) {
38 if (axis >= inShape.size())
39 THROW_IE_EXCEPTION << "Axis can't be more then number of input shapes";
42 outShapes[0][axis] = sum;
46 } // namespace ShapeInfer
47 } // namespace InferenceEngine