Removed shape infer extension (#917)
[platform/upstream/dldt.git] / inference-engine / src / legacy_api / include / ie_ishape_infer_extension.hpp
1 // Copyright (C) 2018-2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #pragma once
6
7 #include <vector>
8 #include <map>
9
10 #include "details/ie_irelease.hpp"
11 #include "ie_version.hpp"
12 #include "ie_common.h"
13 #include "ie_blob.h"
14
15 namespace InferenceEngine {
16
17 /**
18  * @class IShapeInferImpl
19  * @brief This class provides interface for the implementation with the custom execution code
20  */
21 class IShapeInferImpl {
22 public:
23     /**
24      * @brief A shared pointer to a IShapeInferImpl object
25      */
26     using Ptr = std::shared_ptr<IShapeInferImpl>;
27
28     virtual ~IShapeInferImpl() = default;
29
30     /**
31      * @brief check that reshape can be applied, that parameters and shapes are valid
32      */
33     virtual StatusCode inferShapes(const std::vector<Blob::CPtr>& /*inBlobs*/,
34                                    const std::map<std::string, std::string>& /*params*/,
35                                    const std::map<std::string, Blob::Ptr>& /*blobs*/,
36                                    std::vector<SizeVector>& /*outShapes*/, ResponseDesc* /*resp*/) noexcept {
37         return NOT_IMPLEMENTED;
38     }  // For backward-compatibility
39 };
40
41 /**
42  * @class IShapeInferExtension
43  * @brief This class is the reader extension interface to provide implementation for shape propagation
44  */
45 class IShapeInferExtension : public InferenceEngine::details::IRelease {
46 public:
47     /**
48      * @brief Gets extension version information and stores in versionInfo
49      * @param versionInfo Pointer to version info, will be set by plugin
50      */
51     virtual void GetVersion(const InferenceEngine::Version*& versionInfo) const noexcept = 0;
52
53     /**
54      * @brief Cleans resources up
55      */
56     virtual void Unload() noexcept = 0;
57
58     /**
59      * The method will be removed in 2021.1 release.
60      * @brief Fills passed array with types of layers which shape infer implementations are included in the extension
61      *
62      * @param types Array to store the layer types
63      * @param size Size of the layer types array
64      * @param resp Response descriptor
65      * @return Status code
66      */
67     virtual StatusCode getShapeInferTypes(char**& types, unsigned int& size, ResponseDesc* resp) noexcept = 0;
68
69     /**
70      * @brief Gets shape propagation implementation for the given string-type of CNNLayer
71      *
72      * @param impl the vector with implementations which is ordered by priority
73      * @param type A type of CNNLayer
74      * @param resp response descriptor
75      * @return status code
76      */
77     virtual StatusCode getShapeInferImpl(IShapeInferImpl::Ptr& impl, const char* type, ResponseDesc* resp) noexcept = 0;
78 };
79
80 /**
81  * This API will be removed in 2021.1 release.
82  * @brief A shared pointer to a IShapeInferExtension interface
83  */
84 using IShapeInferExtensionPtr = std::shared_ptr<IShapeInferExtension>;
85
86 }  // namespace InferenceEngine