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"
14 namespace InferenceEngine {
15 namespace ShapeInfer {
18 *@brief Implementation of Shape inference for DetectionOutput layer
20 class RNNShapeProp : public BuiltInShapeInferImpl {
22 explicit RNNShapeProp(const std::string& type) : BuiltInShapeInferImpl(type) {}
24 void inferShapesImpl(const std::vector<Blob::CPtr>& inBlobs,
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 RNNSequenceLayer rnn(lp);
32 rnn.precision = Precision::FP32; // FIXME: No ability to discover current precision. Assume fp32
33 validate(&rnn, inBlobs, params, blobs);
35 int state_size = rnn.hidden_size;
37 auto data_dims = inShapes[0];
38 data_dims[2] = static_cast<size_t>(state_size);
39 outShapes.push_back(data_dims);
41 for (int i = 1; i < inShapes.size(); i++) {
42 outShapes.push_back(inShapes[i]);
47 } // namespace ShapeInfer
48 } // namespace InferenceEngine