-// Copyright (C) 2018 Intel Corporation
+// Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <ie_layers.h>
#include <ie_context.hpp>
-#include "../ie_network.hpp"
+#include <builders/ie_network_builder.hpp>
#include "details/caseless.hpp"
#include "ie_reshape_launcher.hpp"
#include "ie_icnn_network.hpp"
* @param network - const reference to the ICNNNetwork for performing shape inference
*/
explicit Reshaper(ICNNNetwork& network,
- const LauncherCreator::Ptr& creator = std::make_shared<LauncherCreator>());
+ const LauncherCreator::Ptr& creator = std::make_shared<LauncherCreator>());
- Reshaper(const Context& context, details::Network::Ptr& network);
+ explicit Reshaper(std::vector<DataPtr> inputs,
+ const LauncherCreator::Ptr& launcherCreator = std::make_shared<LauncherCreator>());
+
+ Reshaper(Builder::Network* network);
virtual ~Reshaper() = default;
* @param inputShapes - Map of input names (data) to their input shapes.
*/
StatusCode run(const std::map<std::string, SizeVector>& inputShapes, ResponseDesc* resp = nullptr);
+
+ /**
+ * @brief Perform shape inference for the given input shapes but not apply it.
+ * In case of cusses call apply() method.
+ * @param inputShapes - Map of input names (data) to their input shapes.
+ * @throws exception if shape infer failed without corruption of original shapes
+ */
+ StatusCode runNoApply(const std::map<std::string, SizeVector>& inputShapes, ResponseDesc* resp = nullptr);
+
+ /**
+ * @brief Apply shapes pre calculated by runNoApply() method.
+ */
+ StatusCode apply(ResponseDesc* resp = nullptr);
+
+ /**
+ * @brief Return newly calculated shape for provided data.
+ */
+ SizeVector getResultShapeFor(DataPtr &data, ResponseDesc* resp = nullptr);
+
private:
ReshapeLauncher::Ptr getLauncherByLayerName(const std::string& layerName) const;
std::set<CNNLayerPtr> _inputLayers{};
InferenceEngine::details::caseless_set<std::string> _allTypes;
- Context ctx;
- details::Network::Ptr network;
+ Builder::Network* network;
};
} // namespace ShapeInfer