1 // Copyright (C) 2018-2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
10 #include "details/ie_irelease.hpp"
11 #include "ie_version.hpp"
12 #include "ie_common.h"
15 namespace InferenceEngine {
18 * @class IShapeInferImpl
19 * @brief This class provides interface for the implementation with the custom execution code
21 class IShapeInferImpl {
24 * @brief A shared pointer to a IShapeInferImpl object
26 using Ptr = std::shared_ptr<IShapeInferImpl>;
28 virtual ~IShapeInferImpl() = default;
31 * @brief check that reshape can be applied, that parameters and shapes are valid
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
42 * @class IShapeInferExtension
43 * @brief This class is the reader extension interface to provide implementation for shape propagation
45 class IShapeInferExtension : public InferenceEngine::details::IRelease {
48 * @brief Gets extension version information and stores in versionInfo
49 * @param versionInfo Pointer to version info, will be set by plugin
51 virtual void GetVersion(const InferenceEngine::Version*& versionInfo) const noexcept = 0;
54 * @brief Cleans resources up
56 virtual void Unload() noexcept = 0;
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
62 * @param types Array to store the layer types
63 * @param size Size of the layer types array
64 * @param resp Response descriptor
67 virtual StatusCode getShapeInferTypes(char**& types, unsigned int& size, ResponseDesc* resp) noexcept = 0;
70 * @brief Gets shape propagation implementation for the given string-type of CNNLayer
72 * @param impl the vector with implementations which is ordered by priority
73 * @param type A type of CNNLayer
74 * @param resp response descriptor
77 virtual StatusCode getShapeInferImpl(IShapeInferImpl::Ptr& impl, const char* type, ResponseDesc* resp) noexcept = 0;
81 * This API will be removed in 2021.1 release.
82 * @brief A shared pointer to a IShapeInferExtension interface
84 using IShapeInferExtensionPtr = std::shared_ptr<IShapeInferExtension>;
86 } // namespace InferenceEngine