Removed shape infer extension (#917)

This commit is contained in:
Ilya Lavrenov
2020-06-19 14:48:26 +03:00
committed by GitHub
parent d67371617a
commit bf3f799927
30 changed files with 112 additions and 685 deletions

View File

@@ -259,15 +259,6 @@ public:
INFERENCE_ENGINE_DEPRECATED("Use CNNNetwork::layerCount() instead. The method will be removed in 2021.1")
size_t size() const;
/**
* @deprecated Use Core::AddExtension to add an extension to the library
* @brief Registers extension within the plugin
*
* @param extension Pointer to already loaded reader extension with shape propagation implementations
*/
INFERENCE_ENGINE_DEPRECATED("Use Core::AddExtension to add an extension to the library")
void AddExtension(InferenceEngine::IShapeInferExtensionPtr extension);
/**
* @brief Helper method to get collect all input shapes with names of corresponding Data objects
*

View File

@@ -33,20 +33,6 @@ public:
static constexpr auto name = "CreateExtension";
};
/**
* @deprecated Implement IExtension interface. The interface will be removed in 2021.1 release.
* @brief The SOCreatorTrait class specialization for IShapeInferExtension case, defines the name of the fabric method for
* creating IExtension object in DLL
*/
template <>
class INFERENCE_ENGINE_DEPRECATED("Implement IExtension") SOCreatorTrait<IShapeInferExtension> {
public:
/**
* @brief A name of the fabric method for creating an IShapeInferExtension object in DLL
*/
static constexpr auto name = "CreateShapeInferExtension";
};
} // namespace details
/**
@@ -118,40 +104,6 @@ public:
}
IE_SUPPRESS_DEPRECATED_END
/**
* @deprecated Implement ngraph::op::Op::validate_and_infer_types method in a custom ngraph operation
* The method will be removed in 2021.1 release.
* @brief Gets shape propagation implementation for the given string-type of CNNLayer
*
* @param impl the vector with implementations which is ordered by priority
* @param type A type of CNNLayer
* @param resp response descriptor
* @return status code
*/
IE_SUPPRESS_DEPRECATED_START
INFERENCE_ENGINE_DEPRECATED("Implement ngraph::op::Op::validate_and_infer_types method in a custom ngraph operation")
StatusCode getShapeInferImpl(IShapeInferImpl::Ptr& impl, const char* type, ResponseDesc* resp) noexcept override {
return actual->getShapeInferImpl(impl, type, resp);
}
IE_SUPPRESS_DEPRECATED_END
/**
* @deprecated Implement ngraph::op::Op::validate_and_infer_types method in a custom ngraph operation
* The method will be removed in 2021.1 release.
* @brief Gets the array with types of layers which are included in the extension
*
* @param types Types array
* @param size Size of the types array
* @param resp Response descriptor
* @return Status code
*/
INFERENCE_ENGINE_DEPRECATED("Implement ngraph::op::Op::validate_and_infer_types method in a custom ngraph operation")
StatusCode getShapeInferTypes(char**& types, unsigned int& size, ResponseDesc* resp) noexcept override {
IE_SUPPRESS_DEPRECATED_START
return actual->getShapeInferTypes(types, size, resp);
IE_SUPPRESS_DEPRECATED_END
}
/**
* @brief Returns operation sets
* This method throws an exception if it was not implemented
@@ -187,79 +139,6 @@ protected:
InferenceEngine::details::SOPointer<IExtension> actual;
};
/**
* @deprecated Use a common Extension class. The interface will be removed in 2021.1 release.
* @brief This class is a C++ helper to work with objects created using extensions.
*/
class INFERENCE_ENGINE_DEPRECATED("Use a common Extension interface") ShapeInferExtension :
public IShapeInferExtension {
public:
/**
* @brief Loads extension from a shared library
*
* @param name Full or relative path to extension library
*/
IE_SUPPRESS_DEPRECATED_START_WIN
explicit ShapeInferExtension(const file_name_t& name): actual(name) {}
IE_SUPPRESS_DEPRECATED_END_WIN
/**
* @brief Gets the extension version information
*
* @param versionInfo A pointer to version info, set by the plugin
*/
void GetVersion(const InferenceEngine::Version*& versionInfo) const noexcept override {
actual->GetVersion(versionInfo);
}
/**
* @brief Cleans the resources up
*/
void Unload() noexcept override {
actual->Unload();
}
/**
* @brief Does nothing since destruction is done via the regular mechanism
*/
void Release() noexcept override {}
INFERENCE_ENGINE_DEPRECATED("Implement ngraph::op::Op::validate_and_infer_types method in a custom ngraph operation")
StatusCode getShapeInferTypes(char**& types, unsigned int& size, ResponseDesc* resp) noexcept override {
IE_SUPPRESS_DEPRECATED_START
return actual->getShapeInferTypes(types, size, resp);
IE_SUPPRESS_DEPRECATED_END
}
INFERENCE_ENGINE_DEPRECATED("Implement ngraph::op::Op::validate_and_infer_types method in a custom ngraph operation")
StatusCode getShapeInferImpl(IShapeInferImpl::Ptr& impl, const char* type, ResponseDesc* resp) noexcept override {
IE_SUPPRESS_DEPRECATED_START
return actual->getShapeInferImpl(impl, type, resp);
IE_SUPPRESS_DEPRECATED_END
}
protected:
/**
* @brief A SOPointer instance to the loaded templated object
*/
InferenceEngine::details::SOPointer<IShapeInferExtension> actual;
};
IE_SUPPRESS_DEPRECATED_END_WIN
/**
* @deprecated Use make_so_pointer with IExtension as template argument type.
* @brief Creates a special shared_pointer wrapper for the given type from a specific shared module
*
* @param name Name of the shared library file
* @return shared_pointer A wrapper for the given type from a specific shared module
*/
template <>
inline std::shared_ptr<IShapeInferExtension> make_so_pointer(const file_name_t& name) {
IE_SUPPRESS_DEPRECATED_START
return std::make_shared<ShapeInferExtension>(name);
IE_SUPPRESS_DEPRECATED_END
}
/**
* @brief Creates a special shared_pointer wrapper for the given type from a specific shared module
*

View File

@@ -218,17 +218,6 @@ public:
return NOT_IMPLEMENTED;
};
/**
* @deprecated Use Core::AddExtension to add an extension to the library
* @brief Registers extension within the plugin
*
* @param extension Pointer to already loaded reader extension with shape propagation implementations
* @param resp Pointer to the response message that holds a description of an error if any occurred
* @return Status code of the operation. InferenceEngine::OK if succeeded
*/
INFERENCE_ENGINE_DEPRECATED("Use Core::AddExtension to add an extension to the library")
virtual StatusCode AddExtension(const IShapeInferExtensionPtr& extension, ResponseDesc* resp) noexcept;
/**
* @deprecated Migrate to IR v10 and use quantization approach with FakeQuantize
* @brief Gets the statistics.

View File

@@ -176,87 +176,10 @@ public:
virtual StatusCode getImplementations(std::vector<ILayerImpl::Ptr>& impls, ResponseDesc* resp) noexcept = 0;
};
/**
* @deprecated Implement ngraph::op::Op::validate_and_infer_types method in a custom ngraph operation.
* The interface will be removed in 2021.1 release.
* @class IShapeInferImpl
* @brief This class provides interface for the implementation with the custom execution code
*/
class INFERENCE_ENGINE_DEPRECATED("Implement ngraph::op::Op::validate_and_infer_types method in a custom ngraph operation") IShapeInferImpl {
public:
/**
* @brief A shared pointer to a IShapeInferImpl object
*/
IE_SUPPRESS_DEPRECATED_START
using Ptr = std::shared_ptr<IShapeInferImpl>;
IE_SUPPRESS_DEPRECATED_END
virtual ~IShapeInferImpl() = default;
/**
* @brief check that reshape can be applied, that parameters and shapes are valid
*/
virtual StatusCode inferShapes(const std::vector<Blob::CPtr>& /*inBlobs*/,
const std::map<std::string, std::string>& /*params*/,
const std::map<std::string, Blob::Ptr>& /*blobs*/,
std::vector<SizeVector>& /*outShapes*/, ResponseDesc* /*resp*/) noexcept {
return NOT_IMPLEMENTED;
} // For backward-compatibility
};
/**
* @deprecated Implement a custom ngraph operation derived from ngraph::op::Op in IExtension implementation
* @class IShapeInferExtension
* @brief This class is the reader extension interface to provide implementation for shape propagation
*/
class IShapeInferExtension : public InferenceEngine::details::IRelease {
public:
/**
* @brief Gets extension version information and stores in versionInfo
* @param versionInfo Pointer to version info, will be set by plugin
*/
virtual void GetVersion(const InferenceEngine::Version*& versionInfo) const noexcept = 0;
/**
* @brief Cleans resources up
*/
virtual void Unload() noexcept = 0;
/**
* @deprecated Implement ngraph::op::Op::validate_and_infer_types method in a custom ngraph operation.
* The method will be removed in 2021.1 release.
* @brief Fills passed array with types of layers which shape infer implementations are included in the extension
*
* @param types Array to store the layer types
* @param size Size of the layer types array
* @param resp Response descriptor
* @return Status code
*/
INFERENCE_ENGINE_DEPRECATED("Implement ngraph::op::Op::validate_and_infer_types method in a custom ngraph operation")
virtual StatusCode getShapeInferTypes(char**& types, unsigned int& size, ResponseDesc* resp) noexcept = 0;
/**
* @deprecated Implement ngraph::op::Op::validate_and_infer_types method in a custom ngraph operation.
* The method will be removed in 2021.1 release.
* @brief Gets shape propagation implementation for the given string-type of CNNLayer
*
* @param impl the vector with implementations which is ordered by priority
* @param type A type of CNNLayer
* @param resp response descriptor
* @return status code
*/
IE_SUPPRESS_DEPRECATED_START
INFERENCE_ENGINE_DEPRECATED("Implement ngraph::op::Op::validate_and_infer_types method in a custom ngraph operation")
virtual StatusCode getShapeInferImpl(IShapeInferImpl::Ptr& impl, const char* type, ResponseDesc* resp) noexcept = 0;
IE_SUPPRESS_DEPRECATED_END
};
IE_SUPPRESS_DEPRECATED_START_WIN
/**
* @brief This class is the main extension interface
*/
class INFERENCE_ENGINE_API_CLASS(IExtension) : public IShapeInferExtension {
class INFERENCE_ENGINE_API_CLASS(IExtension) : public InferenceEngine::details::IRelease {
public:
/**
* @deprecated Use IExtension::getImplementation to get a concrete implementation
@@ -296,16 +219,6 @@ public:
return NOT_IMPLEMENTED;
}
INFERENCE_ENGINE_DEPRECATED("Implement ngraph::op::Op::validate_and_infer_types method in a custom ngraph operation")
StatusCode getShapeInferTypes(char**&, unsigned int&, ResponseDesc*) noexcept override {
return NOT_IMPLEMENTED;
}
INFERENCE_ENGINE_DEPRECATED("Implement ngraph::op::Op::validate_and_infer_types method in a custom ngraph operation")
StatusCode getShapeInferImpl(IShapeInferImpl::Ptr&, const char*, ResponseDesc*) noexcept override {
return NOT_IMPLEMENTED;
}
/**
* @brief Returns operation sets
* This method throws an exception if it was not implemented
@@ -334,22 +247,24 @@ public:
(void)implType;
return nullptr;
}
};
IE_SUPPRESS_DEPRECATED_END_WIN
/**
* @brief Cleans resources up
*/
virtual void Unload() noexcept = 0;
/**
* @brief Gets extension version information and stores in versionInfo
* @param versionInfo Pointer to version info, will be set by plugin
*/
virtual void GetVersion(const InferenceEngine::Version*& versionInfo) const noexcept = 0;
};
/**
* @brief A shared pointer to a IExtension interface
*/
using IExtensionPtr = std::shared_ptr<IExtension>;
/**
* @deprecated Migrate to IR v10 and implement shape inference in the ngraph::op::Op::validate_and_infer_types method
* This API will be removed in 2021.1 release.
* @brief A shared pointer to a IShapeInferExtension interface
*/
using IShapeInferExtensionPtr = std::shared_ptr<IShapeInferExtension>;
/**
* @brief Creates the default instance of the extension
*
@@ -359,16 +274,4 @@ using IShapeInferExtensionPtr = std::shared_ptr<IShapeInferExtension>;
*/
INFERENCE_EXTENSION_API(StatusCode) CreateExtension(IExtension*& ext, ResponseDesc* resp) noexcept;
/**
* @deprecated Migrate to IR v10 and implement shape inference in the ngraph::op::Op::validate_and_infer_types method
* This API will be removed in 2021.1 release.
* @brief Creates the default instance of the shape infer extension
*
* @param ext Shape Infer Extension interface
* @param resp Response description
* @return Status code
*/
INFERENCE_EXTENSION_API(StatusCode)
CreateShapeInferExtension(IShapeInferExtension*& ext, ResponseDesc* resp) noexcept;
} // namespace InferenceEngine