Removed TensorDesc from OpenVINO Runtime API (#7587)

* Removed TensorDesc from OpenVINO Runtime API

* Fixed docs
This commit is contained in:
Ilya Lavrenov 2021-09-23 10:41:14 +03:00 committed by GitHub
parent 1390440256
commit e253b5931c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 9 deletions

View File

@ -3,9 +3,9 @@
// //
/** /**
* @brief This is a header file for the IE RemoteContext and RemoteBlob classes * @brief This is a header file for the OpenVINO Runtime RemoteContext class
* *
* @file ie_remote_context.hpp * @file openvino/runtime/remote_context.hpp
*/ */
#pragma once #pragma once
@ -14,6 +14,8 @@
#include <string> #include <string>
#include "ie_remote_context.hpp" #include "ie_remote_context.hpp"
#include "openvino/core/shape.hpp"
#include "openvino/core/type/element_type.hpp"
#include "openvino/runtime/common.hpp" #include "openvino/runtime/common.hpp"
#include "openvino/runtime/parameter.hpp" #include "openvino/runtime/parameter.hpp"
@ -111,15 +113,18 @@ public:
std::string get_device_name() const; std::string get_device_name() const;
/** /**
* @brief Allocates memory blob in device memory or wraps user-supplied memory handle * @brief Allocates memory tensor in device memory or wraps user-supplied memory handle
* using the specified tensor description and low-level device-specific parameters. * using the specified tensor description and low-level device-specific parameters.
* Returns a pointer to the object which implements RemoteBlob interface. * Returns a pointer to the object which implements RemoteTensor interface.
* @param tensorDesc Defines the layout and dims of the blob * @param element_type Defines the element type of the tensor
* @param params Map of the low-level blob object parameters. * @param shape Defines the shape of the tensor
* @param params Map of the low-level tensor object parameters.
* Abstract method. * Abstract method.
* @return A pointer to plugin object that implements RemoteBlob interface. * @return A pointer to plugin object that implements RemoteTensor interface.
*/ */
std::shared_ptr<ie::RemoteBlob> create_blob(const ie::TensorDesc& tensorDesc, const ParamMap& params = {}); std::shared_ptr<ie::RemoteBlob> create_blob(element::Type element_type,
const Shape& shape,
const ParamMap& params = {});
/** /**
* @brief Returns a map of device-specific parameters required for low-level * @brief Returns a map of device-specific parameters required for low-level

View File

@ -6,6 +6,7 @@
#include <exception> #include <exception>
#include "ie_ngraph_utils.hpp"
#include "ie_remote_blob.hpp" #include "ie_remote_blob.hpp"
#include "openvino/core/except.hpp" #include "openvino/core/except.hpp"
#include "openvino/runtime/remote_context.hpp" #include "openvino/runtime/remote_context.hpp"
@ -31,8 +32,12 @@ std::string RemoteContext::get_device_name() const {
OV_REMOTE_CONTEXT_STATEMENT(return _impl->getDeviceName()); OV_REMOTE_CONTEXT_STATEMENT(return _impl->getDeviceName());
} }
std::shared_ptr<ie::RemoteBlob> RemoteContext::create_blob(const ie::TensorDesc& tensorDesc, std::shared_ptr<ie::RemoteBlob> RemoteContext::create_blob(element::Type type,
const Shape& shape,
const ie::ParamMap& params) { const ie::ParamMap& params) {
ie::TensorDesc tensorDesc(ie::details::convertPrecision(type),
shape,
ie::TensorDesc::getLayoutByRank(shape.size()));
OV_REMOTE_CONTEXT_STATEMENT(return _impl->CreateBlob(tensorDesc, params)); OV_REMOTE_CONTEXT_STATEMENT(return _impl->CreateBlob(tensorDesc, params));
} }