Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / src / inference_engine / shape_infer / ie_reshape_launcher.hpp
index 5a9de53..28083c6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Intel Corporation
+// Copyright (C) 2018-2019 Intel Corporation
 // SPDX-License-Identifier: Apache-2.0
 //
 
@@ -12,6 +12,7 @@
 #include <memory>
 
 #include <ie_layers.h>
+#include "shape_infer/const_infer/ie_const_infer_impl.hpp"
 #include "shape_infer/built-in/ie_built_in_holder.hpp"
 
 namespace InferenceEngine {
@@ -60,6 +61,14 @@ public:
      */
     virtual void setShapeByName(const SizeVector& shape, const std::string& dataName);
 
+    virtual void setBlobByName(const Blob::CPtr& blob, const std::string& dataName);
+
+    /**
+     * @brief Return calculated shape for data with requested name.
+     * @return Result shape
+     */
+    virtual SizeVector getShapeByName(const std::string& dataName);
+
     /**
      * @brief Set input shape from IR by Data name. If there's no Data with given name it throws exception
      * @param dataName - name of the corresponding Data.
@@ -74,6 +83,8 @@ public:
      */
     virtual void reshape(const std::set<ReshapeLauncher::Ptr>& launchers);
 
+    virtual void constInfer(const std::set<ReshapeLauncher::Ptr>& launchers);
+
     /**
      * @brief Apply new input shapes, calculated output shapes and changed layer's params to CNNLayer and Data.
      * @param layer - pointer to the layer for setting changes in layer's params
@@ -86,7 +97,6 @@ public:
      */
     virtual void reset();
 
-    // TODO: use layer instead?
     virtual std::string getLayerName() const;
 
     virtual std::string getLayerType() const;
@@ -99,7 +109,8 @@ protected:
     InputController* _iController = nullptr;
     OutputController* _oController = nullptr;
     const CNNLayer* _layer;
-    IShapeInferImpl::Ptr _impl;
+    IShapeInferImpl::Ptr _reshapeImpl;
+    IConstInferImpl::Ptr _inferImpl;
 
 protected:
     /**
@@ -134,6 +145,8 @@ public:
     FakeReshapeLauncher(const CNNLayer* layer, const IShapeInferImpl::Ptr& impl);
 
     void reshape(const std::set<ReshapeLauncher::Ptr>& launchers) override;
+
+    void constInfer(const std::set<ReshapeLauncher::Ptr>& launchers) override {}
 };
 
 class OutputOnlyInitializer : public DefaultInitializer {
@@ -163,6 +176,10 @@ public:
     void applyChanges(CNNLayer* layer) override;
 
     void reset() override;
+
+    void setBlobByName(const Blob::CPtr& blob, const std::string& dataName) override;
+
+    void constInfer(const std::set<ReshapeLauncher::Ptr>& launchers) override;
 };
 
 class InputInitializer : public OutputOnlyInitializer {
@@ -222,11 +239,13 @@ public:
 
     OutMemoryReshapeLauncher(const CNNLayer* layer1, const IShapeInferImpl::Ptr& impl1);
 
-    void reshape(const std::set<ReshapeLauncher::Ptr>& launchers) override;
+    void reshape(const std::set<ReshapeLauncher::Ptr>& launchers) override {}
 
     void applyChanges(CNNLayer* layer) override;
 
     void reset() override;
+
+    void constInfer(const std::set<ReshapeLauncher::Ptr>& launchers) override {}
 };
 
 }  // namespace ShapeInfer