Removed runtime::Tensor alias (#22429)
* Removed AllocatorImpl, runtime::Tensor alias * Update OMZ * Updated submodule
This commit is contained in:
parent
cb679a73c9
commit
b0e507c6c3
|
|
@ -14,9 +14,9 @@
|
|||
|
||||
#include "openvino/core/any.hpp"
|
||||
#include "openvino/core/core_visibility.hpp"
|
||||
#include "openvino/core/deprecated.hpp"
|
||||
|
||||
namespace ov {
|
||||
|
||||
class Tensor;
|
||||
|
||||
/**
|
||||
|
|
@ -158,10 +158,4 @@ public:
|
|||
explicit operator bool() const noexcept;
|
||||
};
|
||||
|
||||
OPENVINO_SUPPRESS_DEPRECATED_START
|
||||
namespace runtime {
|
||||
using ov::Allocator;
|
||||
} // namespace runtime
|
||||
OPENVINO_SUPPRESS_DEPRECATED_END
|
||||
|
||||
} // namespace ov
|
||||
|
|
|
|||
|
|
@ -259,9 +259,4 @@ public:
|
|||
*/
|
||||
using TensorVector = std::vector<Tensor>;
|
||||
|
||||
namespace runtime {
|
||||
using ov::Tensor;
|
||||
using ov::TensorVector;
|
||||
} // namespace runtime
|
||||
|
||||
} // namespace ov
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ public:
|
|||
m_shape_set = true;
|
||||
}
|
||||
|
||||
void set_from(const ov::runtime::Tensor& runtime_tensor) {
|
||||
void set_from(const ov::Tensor& runtime_tensor) {
|
||||
set_shape(runtime_tensor.get_shape());
|
||||
set_element_type(runtime_tensor.get_element_type());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ protected:
|
|||
|
||||
for (size_t i = 0; i < funcInputs.size(); ++i) {
|
||||
const auto& funcInput = funcInputs[i];
|
||||
ov::runtime::Tensor tensor;
|
||||
ov::Tensor tensor;
|
||||
ov::test::utils::InputGenerateData in_data;
|
||||
|
||||
if (funcInput.get_node()->get_friendly_name() == "data") {
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ protected:
|
|||
|
||||
for (size_t i = 0; i < funcInputs.size(); ++i) {
|
||||
const auto& funcInput = funcInputs[i];
|
||||
ov::runtime::Tensor tensor;
|
||||
ov::Tensor tensor;
|
||||
ov::test::utils::InputGenerateData in_data;
|
||||
|
||||
if (funcInput.get_node()->get_friendly_name() == "data") {
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public:
|
|||
auto node = funcInputs[2].get_node_shared_ptr();
|
||||
auto it = inputs.find(node);
|
||||
if (it == inputs.end()) return;
|
||||
auto tensor = ov::runtime::Tensor(node->get_element_type(), targetInputStaticShapes[2], &maxOutBoxesPerClass);
|
||||
auto tensor = ov::Tensor(node->get_element_type(), targetInputStaticShapes[2], &maxOutBoxesPerClass);
|
||||
inputs[node] = tensor;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -152,21 +152,21 @@ protected:
|
|||
const auto& funcInputs = function->inputs();
|
||||
auto funcInput = funcInputs.begin();
|
||||
inputs.clear();
|
||||
runtime::Tensor data_tensor = test::utils::create_and_fill_tensor_normal_distribution(funcInput->get_element_type(),
|
||||
ov::Tensor data_tensor = test::utils::create_and_fill_tensor_normal_distribution(funcInput->get_element_type(),
|
||||
targetInputStaticShapes[0], 0, 1, 0);
|
||||
|
||||
inputs.insert({funcInput->get_node_shared_ptr(), data_tensor});
|
||||
funcInput++;
|
||||
if (!constAxes && funcInput != funcInputs.end()) {
|
||||
ASSERT_TRUE(inputIdx < axes.size());
|
||||
auto tensor = ov::runtime::Tensor{funcInput->get_element_type(), Shape{axes[inputIdx].size()}};
|
||||
auto tensor = ov::Tensor{funcInput->get_element_type(), Shape{axes[inputIdx].size()}};
|
||||
std::memcpy(tensor.data(), axes[inputIdx].data(), axes[inputIdx].size() * sizeof(axes[0][0]));
|
||||
inputs.insert({funcInput->get_node_shared_ptr(), tensor});
|
||||
funcInput++;
|
||||
}
|
||||
if (!constSignalSizes && funcInput != funcInputs.end()) {
|
||||
ASSERT_TRUE(inputIdx < signalSizes.size());
|
||||
auto tensor = ov::runtime::Tensor{funcInput->get_element_type(), Shape{signalSizes[inputIdx].size()}};
|
||||
auto tensor = ov::Tensor{funcInput->get_element_type(), Shape{signalSizes[inputIdx].size()}};
|
||||
std::memcpy(tensor.data(), signalSizes[inputIdx].data(), signalSizes[inputIdx].size() * sizeof(signalSizes[0][0]));
|
||||
inputs.insert({funcInput->get_node_shared_ptr(), tensor});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,11 +83,11 @@ protected:
|
|||
const auto& funcInputs = function->inputs();
|
||||
for (size_t i = 0; i < funcInputs.size(); ++i) {
|
||||
const auto& funcInput = funcInputs[i];
|
||||
ov::runtime::Tensor tensor;
|
||||
ov::Tensor tensor;
|
||||
if (i == 1) {
|
||||
#define RESHAPE_TEST_CASE(INT_TYPE) \
|
||||
case ov::element::Type_t::INT_TYPE: { \
|
||||
tensor = ov::runtime::Tensor{ov::element::INT_TYPE, targetInputStaticShapes[i]}; \
|
||||
tensor = ov::Tensor{ov::element::INT_TYPE, targetInputStaticShapes[i]}; \
|
||||
auto inputData = tensor.data<ov::element_type_traits<ov::element::INT_TYPE>::value_type>(); \
|
||||
ASSERT_TRUE(idx < data.size()); \
|
||||
for (size_t j = 0lu; j < data[idx].size(); ++j) { \
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ protected:
|
|||
|
||||
for (size_t i = 0; i < funcInputs.size(); ++i) {
|
||||
const auto& funcInput = funcInputs[i];
|
||||
ov::runtime::Tensor tensor;
|
||||
ov::Tensor tensor;
|
||||
|
||||
if (funcInput.get_node()->get_friendly_name() == "data") {
|
||||
int32_t range = std::accumulate(targetInputStaticShapes[0].begin(), targetInputStaticShapes[0].end(), 1, std::multiplies<size_t>());
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@ protected:
|
|||
const auto& funcInputs = function->inputs();
|
||||
for (size_t i = 0; i < funcInputs.size(); ++i) {
|
||||
const auto& funcInput = funcInputs[i];
|
||||
ov::runtime::Tensor tensor;
|
||||
ov::Tensor tensor;
|
||||
if (i == 1) {
|
||||
tensor = ov::runtime::Tensor{ov::element::i32, targetInputStaticShapes[i]};
|
||||
tensor = ov::Tensor{ov::element::i32, targetInputStaticShapes[i]};
|
||||
auto inputData = tensor.data<ov::element_type_traits<ov::element::i32>::value_type>();
|
||||
const std::vector<unsigned> data = {38, 38, 15, 4};
|
||||
for (size_t j = 0lu; j < data.size(); ++j) {
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ protected:
|
|||
|
||||
for (size_t i = 0; i < funcInputs.size(); ++i) {
|
||||
const auto& funcInput = funcInputs[i];
|
||||
ov::runtime::Tensor tensor;
|
||||
ov::Tensor tensor;
|
||||
ov::test::utils::InputGenerateData in_data;
|
||||
|
||||
if (funcInput.get_node()->get_friendly_name() == "data") {
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ public:
|
|||
auto node = funcInputs[2].get_node_shared_ptr();
|
||||
auto it = inputs.find(node);
|
||||
if (it == inputs.end()) return;
|
||||
auto tensor = ov::runtime::Tensor(node->get_element_type(), targetInputStaticShapes[2], &maxOutBoxesPerClass);
|
||||
auto tensor = ov::Tensor(node->get_element_type(), targetInputStaticShapes[2], &maxOutBoxesPerClass);
|
||||
inputs[node] = tensor;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ protected:
|
|||
const auto& funcInputs = function->inputs();
|
||||
for (size_t i = 0; i < funcInputs.size(); ++i) {
|
||||
auto node = funcInputs[i].get_node_shared_ptr();
|
||||
auto tensor = ov::runtime::Tensor(node->get_element_type(), targetInputStaticShapes[i]);
|
||||
auto tensor = ov::Tensor(node->get_element_type(), targetInputStaticShapes[i]);
|
||||
if (i == 0) {
|
||||
// All zero inputs for non_zero op
|
||||
auto tensor_ptr = static_cast<int32_t*>(tensor.data());
|
||||
|
|
|
|||
|
|
@ -19,16 +19,16 @@ public:
|
|||
Executable();
|
||||
virtual ~Executable();
|
||||
|
||||
/// \param outputs vector of runtime::Tensor used as outputs
|
||||
/// \param inputs vector of runtime::Tensor used as inputs
|
||||
/// \param outputs vector of Tensor used as outputs
|
||||
/// \param inputs vector of Tensor used as inputs
|
||||
/// \param collect_performance Enable per operation performance statistic
|
||||
/// \returns true if iteration is successful, false otherwise
|
||||
virtual bool call(std::vector<ov::Tensor>& outputs,
|
||||
const std::vector<ov::Tensor>& inputs,
|
||||
bool collect_performance = false) = 0;
|
||||
|
||||
/// \param outputs vector of runtime::Tensor used as outputs
|
||||
/// \param inputs vector of runtime::Tensor used as inputs
|
||||
/// \param outputs vector of Tensor used as outputs
|
||||
/// \param inputs vector of Tensor used as inputs
|
||||
/// \param context Evaluation context
|
||||
/// \param collect_performance Enable per operation performance statistic
|
||||
/// \returns true if iteration is successful, false otherwise
|
||||
|
|
@ -41,14 +41,14 @@ public:
|
|||
virtual void cancel() = 0;
|
||||
|
||||
/// \brief Executes a single iteration of a Function.
|
||||
/// \param outputs vector of runtime::Tensor used as outputs
|
||||
/// \param inputs vector of runtime::Tensor used as inputs
|
||||
/// \param outputs vector of Tensor used as outputs
|
||||
/// \param inputs vector of Tensor used as inputs
|
||||
/// \returns true if iteration is successful, false otherwise
|
||||
bool call_with_validate(std::vector<ov::Tensor>& outputs, const std::vector<ov::Tensor>& inputs);
|
||||
|
||||
/// \brief Validates a Function.
|
||||
/// \param outputs vector of runtime::Tensor used as outputs
|
||||
/// \param inputs vector of runtime::Tensor used as inputs
|
||||
/// \param outputs vector of Tensor used as outputs
|
||||
/// \param inputs vector of Tensor used as inputs
|
||||
void validate(const std::vector<ov::Tensor>& outputs, const std::vector<ov::Tensor>& inputs);
|
||||
|
||||
/// \brief Query the input Parameters
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ struct InterpolateV1Params {
|
|||
Shape outShape;
|
||||
element::Type inType;
|
||||
element::Type outType;
|
||||
runtime::Tensor inData;
|
||||
runtime::Tensor outData;
|
||||
ov::Tensor inData;
|
||||
ov::Tensor outData;
|
||||
std::shared_ptr<op::v0::Constant> outShapeInput;
|
||||
op::v0::Interpolate::Attributes attrs;
|
||||
};
|
||||
|
|
@ -82,8 +82,8 @@ struct InterpolateV4Params {
|
|||
Shape outShape;
|
||||
element::Type inType;
|
||||
element::Type outType;
|
||||
runtime::Tensor inData;
|
||||
runtime::Tensor outData;
|
||||
ov::Tensor inData;
|
||||
ov::Tensor outData;
|
||||
std::vector<size_t> outShapeInput;
|
||||
element::Type outShapeInputType;
|
||||
std::vector<float> scales;
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ struct ReadValueAssignParams {
|
|||
Shape m_output_shape;
|
||||
element::Type m_input_type;
|
||||
element::Type m_output_type;
|
||||
runtime::Tensor m_input_data;
|
||||
runtime::Tensor m_expected_data;
|
||||
ov::Tensor m_input_data;
|
||||
ov::Tensor m_expected_data;
|
||||
std::string m_variable_id;
|
||||
};
|
||||
|
||||
|
|
@ -245,8 +245,8 @@ struct MemoryTestParams {
|
|||
ov::Shape m_output_shape;
|
||||
ov::element::Type m_input_type;
|
||||
ov::element::Type m_output_type;
|
||||
ov::runtime::Tensor m_input_data;
|
||||
ov::runtime::Tensor m_expected_data;
|
||||
ov::Tensor m_input_data;
|
||||
ov::Tensor m_expected_data;
|
||||
std::vector<std::string> m_variable_id;
|
||||
size_t m_count_runs;
|
||||
size_t m_reset_on_run;
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ struct RegionYoloParams {
|
|||
ov::PartialShape inputShape;
|
||||
ov::element::Type inType;
|
||||
ov::element::Type outType;
|
||||
ov::runtime::Tensor inputData;
|
||||
ov::runtime::Tensor refData;
|
||||
ov::Tensor inputData;
|
||||
ov::Tensor refData;
|
||||
std::string testcaseName;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ std::vector<ov::Tensor> ReadIRTest::calculate_refs() {
|
|||
|
||||
size_t pos = 0;
|
||||
for (const auto& output : functionRefs->outputs()) {
|
||||
auto out_tensor = ov::runtime::Tensor(output.get_element_type(), output.get_shape(), &ref_buffer[pos]);
|
||||
auto out_tensor = ov::Tensor(output.get_element_type(), output.get_shape(), &ref_buffer[pos]);
|
||||
pos += out_tensor.get_byte_size();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public:
|
|||
|
||||
protected:
|
||||
void SetUp() override;
|
||||
bool checkOutput(const ov::runtime::Tensor& in, const ov::runtime::Tensor& actual);
|
||||
bool checkOutput(const ov::Tensor& in, const ov::Tensor& actual);
|
||||
|
||||
std::shared_ptr<ov::Core> ie = utils::PluginCache::get().core();
|
||||
std::shared_ptr<Model> function;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ struct OVIterationChaining : public OVInferRequestTests {
|
|||
|
||||
private:
|
||||
static std::shared_ptr<ov::Model> getIterativeFunction();
|
||||
bool checkOutput(const ov::runtime::Tensor& in, const ov::runtime::Tensor& actual);
|
||||
bool checkOutput(const ov::Tensor& in, const ov::Tensor& actual);
|
||||
};
|
||||
|
||||
} // namespace behavior
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ void OVInferRequestDynamicTests::SetUp() {
|
|||
APIBaseTest::SetUp();
|
||||
}
|
||||
|
||||
bool OVInferRequestDynamicTests::checkOutput(const ov::runtime::Tensor& in, const ov::runtime::Tensor& actual) {
|
||||
bool OVInferRequestDynamicTests::checkOutput(const ov::Tensor& in, const ov::Tensor& actual) {
|
||||
bool result = true;
|
||||
auto net = ie->compile_model(function, ov::test::utils::DEVICE_TEMPLATE);
|
||||
ov::InferRequest req;
|
||||
|
|
@ -96,7 +96,7 @@ TEST_P(OVInferRequestDynamicTests, InferDynamicNetwork) {
|
|||
ov::test::utils::InputGenerateData in_data;
|
||||
in_data.start_from = -50;
|
||||
in_data.range = 100;
|
||||
ov::runtime::Tensor inTensor = ov::test::utils::create_and_fill_tensor(element::f32, shape, in_data);
|
||||
ov::Tensor inTensor = ov::test::utils::create_and_fill_tensor(element::f32, shape, in_data);
|
||||
OV_ASSERT_NO_THROW(req = execNet.create_infer_request());
|
||||
OV_ASSERT_NO_THROW(req.set_tensor("input_tensor", inTensor));
|
||||
OV_ASSERT_NO_THROW(req.infer());
|
||||
|
|
@ -115,7 +115,7 @@ TEST_P(OVInferRequestDynamicTests, InferDynamicNetworkSetUnexpectedOutputTensorB
|
|||
auto execNet = ie->compile_model(function, target_device, configuration);
|
||||
// Create InferRequest
|
||||
ov::InferRequest req;
|
||||
ov::runtime::Tensor tensor, otensor;
|
||||
ov::Tensor tensor, otensor;
|
||||
const std::string outputname = function->outputs().back().get_any_name();
|
||||
OV_ASSERT_NO_THROW(req = execNet.create_infer_request());
|
||||
ov::test::utils::InputGenerateData in_data;
|
||||
|
|
@ -144,7 +144,7 @@ TEST_P(OVInferRequestDynamicTests, InferDynamicNetworkSetOutputTensorPreAllocate
|
|||
auto execNet = ie->compile_model(function, target_device, configuration);
|
||||
// Create InferRequest
|
||||
ov::InferRequest req;
|
||||
ov::runtime::Tensor tensor;
|
||||
ov::Tensor tensor;
|
||||
const std::string outputname = function->outputs().back().get_any_name();
|
||||
OV_ASSERT_NO_THROW(req = execNet.create_infer_request());
|
||||
ov::test::utils::InputGenerateData in_data;
|
||||
|
|
@ -153,7 +153,7 @@ TEST_P(OVInferRequestDynamicTests, InferDynamicNetworkSetOutputTensorPreAllocate
|
|||
tensor = ov::test::utils::create_and_fill_tensor(element::f32, refShape, in_data);
|
||||
OV_ASSERT_NO_THROW(req.set_tensor("input_tensor", tensor));
|
||||
float ptr[5000];
|
||||
ov::runtime::Tensor otensor(element::f32, refOutShape, ptr);
|
||||
ov::Tensor otensor(element::f32, refOutShape, ptr);
|
||||
OV_ASSERT_NO_THROW(req.set_tensor(outputname, otensor));
|
||||
OV_ASSERT_NO_THROW(req.infer());
|
||||
ASSERT_EQ(req.get_tensor(outputname).data<float>(), ptr);
|
||||
|
|
@ -172,7 +172,7 @@ TEST_P(OVInferRequestDynamicTests, InferDynamicNetworkSetOutputShapeBeforeInfer)
|
|||
auto execNet = ie->compile_model(function, target_device, configuration);
|
||||
// Create InferRequest
|
||||
ov::InferRequest req;
|
||||
ov::runtime::Tensor tensor, otensor;
|
||||
ov::Tensor tensor, otensor;
|
||||
const std::string outputname = function->outputs().back().get_any_name();
|
||||
OV_ASSERT_NO_THROW(req = execNet.create_infer_request());
|
||||
ov::test::utils::InputGenerateData in_data;
|
||||
|
|
@ -199,7 +199,7 @@ TEST_P(OVInferRequestDynamicTests, InferDynamicNetworkGetOutputThenSetOutputTens
|
|||
auto execNet = ie->compile_model(function, target_device, configuration);
|
||||
// Create InferRequest
|
||||
ov::InferRequest req;
|
||||
ov::runtime::Tensor tensor;
|
||||
ov::Tensor tensor;
|
||||
const std::string outputname = function->outputs().back().get_any_name();
|
||||
OV_ASSERT_NO_THROW(req = execNet.create_infer_request());
|
||||
ov::test::utils::InputGenerateData in_data;
|
||||
|
|
@ -213,7 +213,7 @@ TEST_P(OVInferRequestDynamicTests, InferDynamicNetworkGetOutputThenSetOutputTens
|
|||
ASSERT_TRUE(checkOutput(req.get_tensor("input_tensor"), req.get_tensor(outputname)));
|
||||
// then, set output tensor
|
||||
float ptr[5000];
|
||||
ov::runtime::Tensor otensor(element::f32, refOutShape, ptr);
|
||||
ov::Tensor otensor(element::f32, refOutShape, ptr);
|
||||
OV_ASSERT_NO_THROW(req.set_tensor(outputname, otensor));
|
||||
OV_ASSERT_NO_THROW(req.infer());
|
||||
ASSERT_EQ(req.get_tensor(outputname).data<float>(), ptr);
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ TEST_P(OVInferRequestIOTensorTest, InferStaticNetworkSetChangedInputTensorThrow)
|
|||
OV_ASSERT_NO_THROW(req = execNet.create_infer_request());
|
||||
OV_ASSERT_NO_THROW(req.infer());
|
||||
// Get input_tensor
|
||||
ov::runtime::Tensor tensor;
|
||||
ov::Tensor tensor;
|
||||
OV_ASSERT_NO_THROW(tensor = req.get_tensor(function->inputs().back().get_any_name()));
|
||||
// Set shape
|
||||
OV_ASSERT_NO_THROW(tensor.set_shape(shape2));
|
||||
|
|
@ -258,7 +258,7 @@ TEST_P(OVInferRequestIOTensorTest, InferStaticNetworkSetChangedOutputTensorThrow
|
|||
OV_ASSERT_NO_THROW(req = execNet.create_infer_request());
|
||||
OV_ASSERT_NO_THROW(req.infer());
|
||||
// Get output_tensor
|
||||
ov::runtime::Tensor tensor;
|
||||
ov::Tensor tensor;
|
||||
OV_ASSERT_NO_THROW(tensor = req.get_tensor(function->outputs().back().get_any_name()););
|
||||
// Set shape
|
||||
OV_ASSERT_NO_THROW(tensor.set_shape(shape2));
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ void OVIterationChaining::TearDown() {
|
|||
OVInferRequestTests::TearDown();
|
||||
}
|
||||
|
||||
bool OVIterationChaining::checkOutput(const ov::runtime::Tensor& in, const ov::runtime::Tensor& actual) {
|
||||
bool OVIterationChaining::checkOutput(const ov::Tensor& in, const ov::Tensor& actual) {
|
||||
bool result = true;
|
||||
auto net = core->compile_model(function, ov::test::utils::DEVICE_TEMPLATE);
|
||||
ov::InferRequest req;
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ namespace utils {
|
|||
using CompareMap = std::map<ov::NodeTypeInfo, std::function<void(
|
||||
const std::shared_ptr<ov::Node> &node,
|
||||
size_t port,
|
||||
const ov::runtime::Tensor &expected,
|
||||
const ov::runtime::Tensor &actual,
|
||||
const ov::Tensor &expected,
|
||||
const ov::Tensor &actual,
|
||||
double absThreshold,
|
||||
double relThreshold)>>;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ void reset_const_ranges();
|
|||
|
||||
std::vector<uint8_t> color_test_image(size_t height, size_t width, int b_step, ov::preprocess::ColorFormat format);
|
||||
|
||||
using InputsMap = std::map<ov::NodeTypeInfo, std::function<ov::runtime::Tensor(
|
||||
using InputsMap = std::map<ov::NodeTypeInfo, std::function<ov::Tensor(
|
||||
const std::shared_ptr<ov::Node>& node,
|
||||
size_t port,
|
||||
const ov::element::Type& elemType,
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ public:
|
|||
inputs.clear();
|
||||
const auto& funcInputs = function->inputs();
|
||||
const auto& funcInput = funcInputs.front();
|
||||
auto tensor = ov::runtime::Tensor{ov::element::f32, funcInput.get_shape()};
|
||||
auto tensor = ov::Tensor{ov::element::f32, funcInput.get_shape()};
|
||||
auto inputData = tensor.data<ov::element_type_traits<ov::element::f32>::value_type>();
|
||||
inputData[0] = input_vals[i];
|
||||
inputs.insert({funcInput.get_node_shared_ptr(), tensor});
|
||||
|
|
@ -222,7 +222,7 @@ public:
|
|||
inputs.clear();
|
||||
const auto& funcInputs = function->inputs();
|
||||
const auto& funcInput = funcInputs.front();
|
||||
auto tensor = ov::runtime::Tensor{testPrc, funcInput.get_shape()};
|
||||
auto tensor = ov::Tensor{testPrc, funcInput.get_shape()};
|
||||
auto inputData = tensor.data<ov::element_type_traits<testPrc>::value_type>();
|
||||
inputData[0] = input_vals[i];
|
||||
inputs.insert({funcInput.get_node_shared_ptr(), tensor});
|
||||
|
|
@ -336,7 +336,7 @@ public:
|
|||
|
||||
auto states = inferRequest.query_state();
|
||||
ASSERT_FALSE(states.empty());
|
||||
auto init_tensor = ov::runtime::Tensor{testPrc, ov::Shape{1, 1}};
|
||||
auto init_tensor = ov::Tensor{testPrc, ov::Shape{1, 1}};
|
||||
auto init_data = init_tensor.data<ov::element_type_traits<testPrc>::value_type>();
|
||||
init_data[0] = vec_state[0];
|
||||
states.front().set_state(init_tensor);
|
||||
|
|
@ -348,7 +348,7 @@ public:
|
|||
auto &input_shape = shapes.front();
|
||||
const auto& funcInputs = function->inputs();
|
||||
const auto& funcInput = funcInputs.front();
|
||||
auto tensor = ov::runtime::Tensor{testPrc, input_shape};
|
||||
auto tensor = ov::Tensor{testPrc, input_shape};
|
||||
auto input_data = tensor.data<ov::element_type_traits<testPrc>::value_type>();
|
||||
for (size_t i = 0; i < input_shape.front(); ++i) {
|
||||
input_data[i] = input_vals[i];
|
||||
|
|
@ -507,7 +507,7 @@ public:
|
|||
|
||||
auto states = inferRequest.query_state();
|
||||
ASSERT_FALSE(states.empty());
|
||||
auto init_tensor = ov::runtime::Tensor{testPrc, ov::Shape{1, 1}};
|
||||
auto init_tensor = ov::Tensor{testPrc, ov::Shape{1, 1}};
|
||||
auto init_data = init_tensor.data<ov::element_type_traits<testPrc>::value_type>();
|
||||
init_data[0] = vec_state[0];
|
||||
states.front().set_state(init_tensor);
|
||||
|
|
@ -519,7 +519,7 @@ public:
|
|||
auto &input_shape = shapes.front();
|
||||
const auto& funcInputs = function->inputs();
|
||||
for (auto&& funcInput : funcInputs) {
|
||||
auto tensor = ov::runtime::Tensor{testPrc, input_shape};
|
||||
auto tensor = ov::Tensor{testPrc, input_shape};
|
||||
auto input_data = tensor.data<ov::element_type_traits<testPrc>::value_type>();
|
||||
for (size_t i = 0; i < input_shape[1]; ++i) {
|
||||
input_data[i] = input_vals[i];
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ void ExperimentalDetectronPriorGridGeneratorLayerTest::SetUp() {
|
|||
|
||||
namespace {
|
||||
template<typename T>
|
||||
ov::runtime::Tensor generateTensorByShape(const Shape &shape) {
|
||||
ov::Tensor generateTensorByShape(const Shape &shape) {
|
||||
return ov::test::utils::create_tensor<T>(
|
||||
ov::element::from<T>(),
|
||||
shape,
|
||||
|
|
@ -98,7 +98,7 @@ void ExperimentalDetectronPriorGridGeneratorLayerTest::generate_inputs(const std
|
|||
inputs.insert({funcInputs[i].get_node_shared_ptr(), inputTensors.second[i]});
|
||||
}
|
||||
for (auto j = i; j < funcInputs.size(); ++j) {
|
||||
ov::runtime::Tensor inputTensor = (netPrecision == element::f16)
|
||||
ov::Tensor inputTensor = (netPrecision == element::f16)
|
||||
? generateTensorByShape<ov::float16>(targetInputStaticShapes[j])
|
||||
: generateTensorByShape<float>(
|
||||
targetInputStaticShapes[j]);
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ void ActivationLayerTest::generate_inputs(const std::vector<ov::Shape>& targetIn
|
|||
const auto& funcInputs = function->inputs();
|
||||
auto funcInput = funcInputs.begin();
|
||||
inputs.clear();
|
||||
runtime::Tensor data_tensor = ov::test::utils::create_and_fill_tensor_act_dft(funcInput->get_element_type(),
|
||||
Tensor data_tensor = ov::test::utils::create_and_fill_tensor_act_dft(funcInput->get_element_type(),
|
||||
targetInputStaticShapes[0],
|
||||
data_range,
|
||||
data_start_from,
|
||||
|
|
@ -132,7 +132,7 @@ void ActivationParamLayerTest::generate_inputs(const std::vector<ov::Shape>& tar
|
|||
const auto& funcInputs = function->inputs();
|
||||
for (size_t i = 0; i < funcInputs.size(); ++i) {
|
||||
const auto& funcInput = funcInputs[i];
|
||||
runtime::Tensor data_tensor;
|
||||
Tensor data_tensor;
|
||||
const std::string& name = funcInput.get_node()->get_friendly_name();
|
||||
if (0 == name.compare("negativeSlope")) {
|
||||
ov::test::utils::InputGenerateData in_data;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ void DFTLayerTest::generate_inputs(const std::vector<ov::Shape>& targetInputStat
|
|||
}
|
||||
|
||||
inputs.clear();
|
||||
runtime::Tensor data_tensor = ov::test::utils::create_and_fill_tensor_act_dft(funcInput->get_element_type(),
|
||||
Tensor data_tensor = ov::test::utils::create_and_fill_tensor_act_dft(funcInput->get_element_type(),
|
||||
targetInputStaticShapes[0],
|
||||
inGenData.range, inGenData.start_from, inGenData.resolution, inGenData.seed);
|
||||
inputs.insert({funcInput->get_node_shared_ptr(), data_tensor});
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ void RDFTLayerTest::generate_inputs(const std::vector<ov::Shape>& targetInputSta
|
|||
}
|
||||
|
||||
inputs.clear();
|
||||
runtime::Tensor data_tensor = ov::test::utils::create_and_fill_tensor_act_dft(funcInput->get_element_type(),
|
||||
Tensor data_tensor = ov::test::utils::create_and_fill_tensor_act_dft(funcInput->get_element_type(),
|
||||
targetInputStaticShapes[0],
|
||||
inGenData.range, inGenData.start_from, inGenData.resolution, inGenData.seed);
|
||||
inputs.insert({funcInput->get_node_shared_ptr(), data_tensor});
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ void fill_psroi(ov::Tensor& tensor,
|
|||
int spatialBinsY,
|
||||
const std::string& mode);
|
||||
|
||||
void fill_data_roi(ov::runtime::Tensor& tensor,
|
||||
void fill_data_roi(ov::Tensor& tensor,
|
||||
const uint32_t range,
|
||||
const int height,
|
||||
const int width,
|
||||
|
|
|
|||
|
|
@ -36,46 +36,46 @@ ov::Tensor create_and_fill_tensor(const ov::element::Type element_type,
|
|||
const int seed = 1);
|
||||
|
||||
template <class T>
|
||||
static ov::runtime::Tensor create_tensor(const ov::element::Type& element_type,
|
||||
const ov::Shape& shape,
|
||||
const std::vector<T>& values,
|
||||
const size_t size = 0) {
|
||||
static ov::Tensor create_tensor(const ov::element::Type& element_type,
|
||||
const ov::Shape& shape,
|
||||
const std::vector<T>& values,
|
||||
const size_t size = 0) {
|
||||
const size_t real_size = size ? size : values.size() * sizeof(T) / element_type.size();
|
||||
ov::runtime::Tensor tensor{element_type, shape};
|
||||
ov::Tensor tensor{element_type, shape};
|
||||
std::memcpy(tensor.data(), values.data(), std::min(real_size * element_type.size(), sizeof(T) * values.size()));
|
||||
return tensor;
|
||||
}
|
||||
|
||||
ov::runtime::Tensor create_and_fill_tensor_act_dft(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const uint32_t range = 10,
|
||||
const double_t start_from = 0,
|
||||
const int32_t resolution = 1,
|
||||
const int seed = 1);
|
||||
ov::Tensor create_and_fill_tensor_act_dft(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const uint32_t range = 10,
|
||||
const double_t start_from = 0,
|
||||
const int32_t resolution = 1,
|
||||
const int seed = 1);
|
||||
|
||||
ov::runtime::Tensor create_and_fill_tensor_unique_sequence(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const int32_t start_from = 0,
|
||||
const int32_t resolution = 1,
|
||||
const int seed = 1);
|
||||
ov::Tensor create_and_fill_tensor_unique_sequence(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const int32_t start_from = 0,
|
||||
const int32_t resolution = 1,
|
||||
const int seed = 1);
|
||||
|
||||
ov::runtime::Tensor create_and_fill_tensor_normal_distribution(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const float mean,
|
||||
const float stddev,
|
||||
const int seed = 1);
|
||||
ov::Tensor create_and_fill_tensor_normal_distribution(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const float mean,
|
||||
const float stddev,
|
||||
const int seed = 1);
|
||||
|
||||
ov::runtime::Tensor create_and_fill_tensor_consistently(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const uint32_t range,
|
||||
const int32_t start_from,
|
||||
const int32_t resolution);
|
||||
ov::Tensor create_and_fill_tensor_consistently(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const uint32_t range,
|
||||
const int32_t start_from,
|
||||
const int32_t resolution);
|
||||
|
||||
ov::runtime::Tensor create_and_fill_tensor_real_distribution(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const float min,
|
||||
const float max,
|
||||
const int seed);
|
||||
ov::Tensor create_and_fill_tensor_real_distribution(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const float min,
|
||||
const float max,
|
||||
const int seed);
|
||||
|
||||
void compare(const ov::Tensor& expected,
|
||||
const ov::Tensor& actual,
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ void fill_psroi(ov::Tensor& tensor,
|
|||
}
|
||||
|
||||
template <ov::element::Type_t type>
|
||||
inline void fill_data_roi_impl(ov::runtime::Tensor& tensor,
|
||||
inline void fill_data_roi_impl(ov::Tensor& tensor,
|
||||
const uint32_t range,
|
||||
const int height,
|
||||
const int width,
|
||||
|
|
@ -384,7 +384,7 @@ inline void fill_data_roi_impl(ov::runtime::Tensor& tensor,
|
|||
}
|
||||
}
|
||||
|
||||
void fill_data_roi(ov::runtime::Tensor& tensor,
|
||||
void fill_data_roi(ov::Tensor& tensor,
|
||||
const uint32_t range,
|
||||
const int height,
|
||||
const int width,
|
||||
|
|
|
|||
|
|
@ -174,12 +174,12 @@ ov::Tensor create_and_fill_tensor_unique_sequence(const ov::element::Type elemen
|
|||
return tensor;
|
||||
}
|
||||
|
||||
ov::runtime::Tensor create_and_fill_tensor_normal_distribution(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const float mean,
|
||||
const float stddev,
|
||||
const int seed) {
|
||||
auto tensor = ov::runtime::Tensor{element_type, shape};
|
||||
ov::Tensor create_and_fill_tensor_normal_distribution(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const float mean,
|
||||
const float stddev,
|
||||
const int seed) {
|
||||
auto tensor = ov::Tensor{element_type, shape};
|
||||
#define CASE(X) \
|
||||
case X: \
|
||||
fill_data_ptr_normal_random_float(tensor.data<element_type_traits<X>::value_type>(), \
|
||||
|
|
@ -218,12 +218,12 @@ ov::runtime::Tensor create_and_fill_tensor_normal_distribution(const ov::element
|
|||
return tensor;
|
||||
}
|
||||
|
||||
ov::runtime::Tensor create_and_fill_tensor_real_distribution(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const float min,
|
||||
const float max,
|
||||
const int seed) {
|
||||
auto tensor = ov::runtime::Tensor{element_type, shape};
|
||||
ov::Tensor create_and_fill_tensor_real_distribution(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const float min,
|
||||
const float max,
|
||||
const int seed) {
|
||||
auto tensor = ov::Tensor{element_type, shape};
|
||||
#define CASE(X) \
|
||||
case X: \
|
||||
fill_data_ptr_real_random_float(tensor.data<element_type_traits<X>::value_type>(), \
|
||||
|
|
@ -258,12 +258,12 @@ ov::runtime::Tensor create_and_fill_tensor_real_distribution(const ov::element::
|
|||
return tensor;
|
||||
}
|
||||
|
||||
ov::runtime::Tensor create_and_fill_tensor_consistently(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const uint32_t range,
|
||||
const int32_t start_from,
|
||||
const int32_t resolution) {
|
||||
auto tensor = ov::runtime::Tensor{element_type, shape};
|
||||
ov::Tensor create_and_fill_tensor_consistently(const ov::element::Type element_type,
|
||||
const ov::Shape& shape,
|
||||
const uint32_t range,
|
||||
const int32_t start_from,
|
||||
const int32_t resolution) {
|
||||
auto tensor = ov::Tensor{element_type, shape};
|
||||
#define CASE(X) \
|
||||
case X: \
|
||||
fill_data_ptr_consistently(tensor.data<element_type_traits<X>::value_type>(), \
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit e8fb4cd86a516ce5765290e9665f8afe87b79b2e
|
||||
Subproject commit 126fac1894c806190a0e0a9737b5fc692d7f4baa
|
||||
Loading…
Reference in New Issue