[Template plugin] Unify headers inclusion (#20326)
* Use precise op version - Parameter * Use precise op version - Constant * Use precise op version - Result * Use precise op version - Add, Concat, Subtract * Use precise op version - NMS * Use precise op version - TopK, Broadcast * Use precise op version * Include openvino headers in quotes * Use precise op version - LSTMCell * Fix code style
This commit is contained in:
parent
10d1862715
commit
aa7405fd0e
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <openvino/itt.hpp>
|
#include "openvino/itt.hpp"
|
||||||
|
|
||||||
namespace ov {
|
namespace ov {
|
||||||
namespace template_plugin {
|
namespace template_plugin {
|
||||||
|
@ -2,11 +2,12 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/batch_to_space.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
#include "openvino/opsets/opset2.hpp"
|
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -47,7 +48,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static std::string getTestCaseName(const testing::TestParamInfo<BatchToSpaceParams>& obj) {
|
static std::string getTestCaseName(const testing::TestParamInfo<BatchToSpaceParams>& obj) {
|
||||||
auto param = obj.param;
|
const auto& param = obj.param;
|
||||||
std::ostringstream result;
|
std::ostringstream result;
|
||||||
result << "dType=" << param.dataTensor.type;
|
result << "dType=" << param.dataTensor.type;
|
||||||
result << "_dShape=" << param.dataTensor.shape;
|
result << "_dShape=" << param.dataTensor.shape;
|
||||||
@ -69,11 +70,11 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const BatchToSpaceParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const BatchToSpaceParams& params) {
|
||||||
const auto data = std::make_shared<opset1::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
const auto data = std::make_shared<op::v0::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
||||||
const auto blockShape = std::make_shared<opset1::Parameter>(element::i64, params.blockShapeTensor.shape);
|
const auto blockShape = std::make_shared<op::v0::Parameter>(element::i64, params.blockShapeTensor.shape);
|
||||||
const auto cropsBegin = std::make_shared<opset1::Parameter>(element::i64, params.cropsBeginTensor.shape);
|
const auto cropsBegin = std::make_shared<op::v0::Parameter>(element::i64, params.cropsBeginTensor.shape);
|
||||||
const auto cropsEnd = std::make_shared<opset1::Parameter>(element::i64, params.cropsEndTensor.shape);
|
const auto cropsEnd = std::make_shared<op::v0::Parameter>(element::i64, params.cropsEndTensor.shape);
|
||||||
const auto batchToSpace = std::make_shared<opset2::BatchToSpace>(data, blockShape, cropsBegin, cropsEnd);
|
const auto batchToSpace = std::make_shared<op::v1::BatchToSpace>(data, blockShape, cropsBegin, cropsEnd);
|
||||||
return std::make_shared<Model>(NodeVector{batchToSpace},
|
return std::make_shared<Model>(NodeVector{batchToSpace},
|
||||||
ParameterVector{data, blockShape, cropsBegin, cropsEnd});
|
ParameterVector{data, blockShape, cropsBegin, cropsEnd});
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset8.hpp"
|
#include "openvino/op/constant.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -95,7 +95,7 @@ private:
|
|||||||
const std::vector<uint8_t>& filterData) {
|
const std::vector<uint8_t>& filterData) {
|
||||||
const op::PadType auto_pad{op::PadType::EXPLICIT};
|
const op::PadType auto_pad{op::PadType::EXPLICIT};
|
||||||
const auto in = std::make_shared<op::v0::Parameter>(params.inType, params.inputShape);
|
const auto in = std::make_shared<op::v0::Parameter>(params.inType, params.inputShape);
|
||||||
auto filter = std::make_shared<opset8::Constant>(ov::element::u1, params.filterShape, &filterData[0]);
|
auto filter = std::make_shared<op::v0::Constant>(ov::element::u1, params.filterShape, &filterData[0]);
|
||||||
const auto BinaryConvolution = std::make_shared<op::v1::BinaryConvolution>(in,
|
const auto BinaryConvolution = std::make_shared<op::v1::BinaryConvolution>(in,
|
||||||
filter,
|
filter,
|
||||||
params.strides,
|
params.strides,
|
||||||
|
@ -2,11 +2,14 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/broadcast.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/constant.hpp"
|
||||||
#include "openvino/opsets/opset3.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
|
#include "openvino/op/reverse.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -56,10 +59,10 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const BroadcastParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const BroadcastParams& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
||||||
const auto f = std::make_shared<Model>(
|
const auto f = std::make_shared<Model>(
|
||||||
std::make_shared<opset1::Broadcast>(A,
|
std::make_shared<op::v1::Broadcast>(A,
|
||||||
opset1::Constant::create(params.targetShapeTensor.type,
|
op::v0::Constant::create(params.targetShapeTensor.type,
|
||||||
params.targetShapeTensor.shape,
|
params.targetShapeTensor.shape,
|
||||||
params.targetShapeTensor.data.data())),
|
params.targetShapeTensor.data.data())),
|
||||||
ParameterVector{A});
|
ParameterVector{A});
|
||||||
@ -74,10 +77,10 @@ TEST_P(ReferenceBroadcastTest, CompareWithRefs) {
|
|||||||
class ReferenceBroadcastTestV3 : public ReferenceBroadcastTest {
|
class ReferenceBroadcastTestV3 : public ReferenceBroadcastTest {
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const BroadcastParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const BroadcastParams& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
||||||
const auto f = std::make_shared<Model>(
|
const auto f = std::make_shared<Model>(
|
||||||
std::make_shared<opset3::Broadcast>(A,
|
std::make_shared<op::v3::Broadcast>(A,
|
||||||
opset1::Constant::create(params.targetShapeTensor.type,
|
op::v0::Constant::create(params.targetShapeTensor.type,
|
||||||
params.targetShapeTensor.shape,
|
params.targetShapeTensor.shape,
|
||||||
params.targetShapeTensor.data.data())),
|
params.targetShapeTensor.data.data())),
|
||||||
ParameterVector{A});
|
ParameterVector{A});
|
||||||
@ -132,13 +135,13 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const BroadcastParamsExplicitAxis& params) {
|
static std::shared_ptr<Model> CreateFunction(const BroadcastParamsExplicitAxis& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
||||||
const auto f = std::make_shared<Model>(
|
const auto f = std::make_shared<Model>(
|
||||||
std::make_shared<opset1::Broadcast>(A,
|
std::make_shared<op::v1::Broadcast>(A,
|
||||||
opset1::Constant::create(params.targetShapeTensor.type,
|
op::v0::Constant::create(params.targetShapeTensor.type,
|
||||||
params.targetShapeTensor.shape,
|
params.targetShapeTensor.shape,
|
||||||
params.targetShapeTensor.data.data()),
|
params.targetShapeTensor.data.data()),
|
||||||
opset1::Constant::create(params.axesMappingTensor.type,
|
op::v0::Constant::create(params.axesMappingTensor.type,
|
||||||
params.axesMappingTensor.shape,
|
params.axesMappingTensor.shape,
|
||||||
params.axesMappingTensor.data.data())),
|
params.axesMappingTensor.data.data())),
|
||||||
ParameterVector{A});
|
ParameterVector{A});
|
||||||
@ -203,15 +206,15 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const BroadcastParamsTestHelper& params) {
|
static std::shared_ptr<Model> CreateFunction(const BroadcastParamsTestHelper& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(element::f32, params.shapeA);
|
const auto A = std::make_shared<op::v0::Parameter>(element::f32, params.shapeA);
|
||||||
const auto shape_const = opset1::Constant::create(element::u64, Shape{params.shapeR.size()}, params.shapeR);
|
const auto shape_const = op::v0::Constant::create(element::u64, Shape{params.shapeR.size()}, params.shapeR);
|
||||||
std::shared_ptr<Node> broadcast;
|
std::shared_ptr<Node> broadcast;
|
||||||
if (params.axes.size() > 0) {
|
if (params.axes.size() > 0) {
|
||||||
auto axes_const =
|
auto axes_const =
|
||||||
opset1::Constant::create(element::i64, Shape{params.axes.size()}, params.axes.to_vector());
|
op::v0::Constant::create(element::i64, Shape{params.axes.size()}, params.axes.to_vector());
|
||||||
broadcast = std::make_shared<opset1::Broadcast>(A, shape_const, axes_const);
|
broadcast = std::make_shared<op::v1::Broadcast>(A, shape_const, axes_const);
|
||||||
} else {
|
} else {
|
||||||
broadcast = std::make_shared<opset1::Broadcast>(A, shape_const);
|
broadcast = std::make_shared<op::v1::Broadcast>(A, shape_const);
|
||||||
}
|
}
|
||||||
auto f = std::make_shared<Model>(broadcast, ParameterVector{A});
|
auto f = std::make_shared<Model>(broadcast, ParameterVector{A});
|
||||||
return f;
|
return f;
|
||||||
@ -239,18 +242,18 @@ TEST_P(ReferenceBroadcastTestTestHelper, CompareWithRefs) {
|
|||||||
class ReferenceBroadcastTestExplicitAxisReversed : public ReferenceBroadcastTestExplicitAxis {
|
class ReferenceBroadcastTestExplicitAxisReversed : public ReferenceBroadcastTestExplicitAxis {
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const BroadcastParamsExplicitAxis& params) {
|
static std::shared_ptr<Model> CreateFunction(const BroadcastParamsExplicitAxis& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
||||||
auto broadcast =
|
auto broadcast =
|
||||||
std::make_shared<opset1::Broadcast>(A,
|
std::make_shared<op::v1::Broadcast>(A,
|
||||||
opset1::Constant::create(params.targetShapeTensor.type,
|
op::v0::Constant::create(params.targetShapeTensor.type,
|
||||||
params.targetShapeTensor.shape,
|
params.targetShapeTensor.shape,
|
||||||
params.targetShapeTensor.data.data()),
|
params.targetShapeTensor.data.data()),
|
||||||
opset1::Constant::create(params.axesMappingTensor.type,
|
op::v0::Constant::create(params.axesMappingTensor.type,
|
||||||
params.axesMappingTensor.shape,
|
params.axesMappingTensor.shape,
|
||||||
params.axesMappingTensor.data.data()));
|
params.axesMappingTensor.data.data()));
|
||||||
auto reverse = std::make_shared<opset1::Reverse>(broadcast,
|
auto reverse = std::make_shared<op::v1::Reverse>(broadcast,
|
||||||
opset1::Constant::create(element::i64, {1}, {1}),
|
op::v0::Constant::create(element::i64, {1}, {1}),
|
||||||
opset1::Reverse::Mode::INDEX);
|
op::v1::Reverse::Mode::INDEX);
|
||||||
auto f = std::make_shared<Model>(NodeVector{reverse}, ParameterVector{A});
|
auto f = std::make_shared<Model>(NodeVector{reverse}, ParameterVector{A});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,15 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/concat.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/add.hpp"
|
||||||
|
#include "openvino/op/constant.hpp"
|
||||||
|
#include "openvino/op/parameter.hpp"
|
||||||
|
#include "openvino/op/subtract.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -68,17 +73,17 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ConcatParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const ConcatParams& params) {
|
||||||
std::shared_ptr<opset1::Parameter> A, B, C;
|
std::shared_ptr<op::v0::Parameter> A, B, C;
|
||||||
if (params.dynamicShape.is_dynamic()) {
|
if (params.dynamicShape.is_dynamic()) {
|
||||||
A = std::make_shared<opset1::Parameter>(params.A.type, params.dynamicShape);
|
A = std::make_shared<op::v0::Parameter>(params.A.type, params.dynamicShape);
|
||||||
B = std::make_shared<opset1::Parameter>(params.B.type, params.dynamicShape);
|
B = std::make_shared<op::v0::Parameter>(params.B.type, params.dynamicShape);
|
||||||
C = std::make_shared<opset1::Parameter>(params.C.type, params.dynamicShape);
|
C = std::make_shared<op::v0::Parameter>(params.C.type, params.dynamicShape);
|
||||||
} else {
|
} else {
|
||||||
A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
C = std::make_shared<opset1::Parameter>(params.C.type, params.C.shape);
|
C = std::make_shared<op::v0::Parameter>(params.C.type, params.C.shape);
|
||||||
}
|
}
|
||||||
auto f = std::make_shared<Model>(std::make_shared<opset1::Concat>(NodeVector{A, B, C}, params.axis),
|
auto f = std::make_shared<Model>(std::make_shared<op::v0::Concat>(NodeVector{A, B, C}, params.axis),
|
||||||
ParameterVector{A, B, C});
|
ParameterVector{A, B, C});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -190,11 +195,11 @@ public:
|
|||||||
NodeVector inputs;
|
NodeVector inputs;
|
||||||
ParameterVector inputs_param;
|
ParameterVector inputs_param;
|
||||||
for (uint32_t i = 0; i < params.numInputs; i++) {
|
for (uint32_t i = 0; i < params.numInputs; i++) {
|
||||||
auto A = std::make_shared<opset1::Parameter>(element::f32, shape_a);
|
auto A = std::make_shared<op::v0::Parameter>(element::f32, shape_a);
|
||||||
inputs_param.push_back(A);
|
inputs_param.push_back(A);
|
||||||
inputs.push_back(A);
|
inputs.push_back(A);
|
||||||
}
|
}
|
||||||
function = std::make_shared<Model>(std::make_shared<opset1::Concat>(inputs, 0), inputs_param);
|
function = std::make_shared<Model>(std::make_shared<op::v0::Concat>(inputs, 0), inputs_param);
|
||||||
|
|
||||||
std::vector<float> ref_result;
|
std::vector<float> ref_result;
|
||||||
for (uint32_t i = 0; i < params.numInputs; i++) {
|
for (uint32_t i = 0; i < params.numInputs; i++) {
|
||||||
@ -309,15 +314,15 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ConcatParamsInPlace2dTensor& params) {
|
static std::shared_ptr<Model> CreateFunction(const ConcatParamsInPlace2dTensor& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
const auto add1 = std::make_shared<opset1::Add>(A, B);
|
const auto add1 = std::make_shared<op::v1::Add>(A, B);
|
||||||
const auto C = std::make_shared<opset1::Parameter>(params.C.type, params.C.shape);
|
const auto C = std::make_shared<op::v0::Parameter>(params.C.type, params.C.shape);
|
||||||
const auto D = std::make_shared<opset1::Parameter>(params.D.type, params.D.shape);
|
const auto D = std::make_shared<op::v0::Parameter>(params.D.type, params.D.shape);
|
||||||
const auto add2 = std::make_shared<opset1::Add>(C, D);
|
const auto add2 = std::make_shared<op::v1::Add>(C, D);
|
||||||
const auto subtract = std::make_shared<opset1::Subtract>(C, A);
|
const auto subtract = std::make_shared<op::v1::Subtract>(C, A);
|
||||||
const auto f =
|
const auto f =
|
||||||
std::make_shared<Model>(std::make_shared<opset1::Concat>(NodeVector{add1, add2, subtract}, params.axis),
|
std::make_shared<Model>(std::make_shared<op::v0::Concat>(NodeVector{add1, add2, subtract}, params.axis),
|
||||||
ParameterVector{A, B, C, D});
|
ParameterVector{A, B, C, D});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -426,16 +431,16 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ConcatParamsInPlacePropagate2dTensor& params) {
|
static std::shared_ptr<Model> CreateFunction(const ConcatParamsInPlacePropagate2dTensor& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
const auto add1 = std::make_shared<opset1::Add>(A, B);
|
const auto add1 = std::make_shared<op::v1::Add>(A, B);
|
||||||
const auto C = std::make_shared<opset1::Parameter>(params.C.type, params.C.shape);
|
const auto C = std::make_shared<op::v0::Parameter>(params.C.type, params.C.shape);
|
||||||
const auto D = std::make_shared<opset1::Parameter>(params.D.type, params.D.shape);
|
const auto D = std::make_shared<op::v0::Parameter>(params.D.type, params.D.shape);
|
||||||
const auto add2 = std::make_shared<opset1::Add>(C, D);
|
const auto add2 = std::make_shared<op::v1::Add>(C, D);
|
||||||
const auto concat1 = std::make_shared<opset1::Concat>(NodeVector{add1, add2}, params.axis);
|
const auto concat1 = std::make_shared<op::v0::Concat>(NodeVector{add1, add2}, params.axis);
|
||||||
const auto subtract = std::make_shared<opset1::Subtract>(C, A);
|
const auto subtract = std::make_shared<op::v1::Subtract>(C, A);
|
||||||
const auto f =
|
const auto f =
|
||||||
std::make_shared<Model>(std::make_shared<opset1::Concat>(NodeVector{concat1, subtract}, params.axis),
|
std::make_shared<Model>(std::make_shared<op::v0::Concat>(NodeVector{concat1, subtract}, params.axis),
|
||||||
ParameterVector{A, B, C, D});
|
ParameterVector{A, B, C, D});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -534,12 +539,12 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ConcatParamsInPlaceTree1& params) {
|
static std::shared_ptr<Model> CreateFunction(const ConcatParamsInPlaceTree1& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
const auto add1 = std::make_shared<opset1::Add>(A, B);
|
const auto add1 = std::make_shared<op::v1::Add>(A, B);
|
||||||
const auto add2 = std::make_shared<opset1::Add>(A, B);
|
const auto add2 = std::make_shared<op::v1::Add>(A, B);
|
||||||
const auto concat = std::make_shared<opset1::Concat>(NodeVector{add1, add2}, params.axis);
|
const auto concat = std::make_shared<op::v0::Concat>(NodeVector{add1, add2}, params.axis);
|
||||||
const auto f = std::make_shared<Model>(std::make_shared<opset1::Add>(concat, concat), ParameterVector{A, B});
|
const auto f = std::make_shared<Model>(std::make_shared<op::v1::Add>(concat, concat), ParameterVector{A, B});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -635,15 +640,15 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ConcatParamsInPlaceTree2& params) {
|
static std::shared_ptr<Model> CreateFunction(const ConcatParamsInPlaceTree2& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
const auto add1 = std::make_shared<opset1::Add>(A, B);
|
const auto add1 = std::make_shared<op::v1::Add>(A, B);
|
||||||
const auto add2 = std::make_shared<opset1::Add>(A, B);
|
const auto add2 = std::make_shared<op::v1::Add>(A, B);
|
||||||
const auto concat1 = std::make_shared<opset1::Concat>(NodeVector{add1, add2}, params.axis);
|
const auto concat1 = std::make_shared<op::v0::Concat>(NodeVector{add1, add2}, params.axis);
|
||||||
const auto concat2 = std::make_shared<opset1::Concat>(NodeVector{add1, add2}, params.axis);
|
const auto concat2 = std::make_shared<op::v0::Concat>(NodeVector{add1, add2}, params.axis);
|
||||||
const auto concat12 = std::make_shared<opset1::Concat>(NodeVector{concat1, concat2}, params.axis);
|
const auto concat12 = std::make_shared<op::v0::Concat>(NodeVector{concat1, concat2}, params.axis);
|
||||||
const auto f =
|
const auto f =
|
||||||
std::make_shared<Model>(std::make_shared<opset1::Add>(concat12, concat12), ParameterVector{A, B});
|
std::make_shared<Model>(std::make_shared<op::v1::Add>(concat12, concat12), ParameterVector{A, B});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -740,17 +745,17 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ConcatParamsInPlaceTree3& params) {
|
static std::shared_ptr<Model> CreateFunction(const ConcatParamsInPlaceTree3& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
const auto concat1 = std::make_shared<opset1::Concat>(NodeVector{A, B}, params.axis);
|
const auto concat1 = std::make_shared<op::v0::Concat>(NodeVector{A, B}, params.axis);
|
||||||
const auto concat2 = std::make_shared<opset1::Concat>(NodeVector{A, B}, params.axis);
|
const auto concat2 = std::make_shared<op::v0::Concat>(NodeVector{A, B}, params.axis);
|
||||||
const auto concat3 = std::make_shared<opset1::Concat>(NodeVector{A, B}, params.axis);
|
const auto concat3 = std::make_shared<op::v0::Concat>(NodeVector{A, B}, params.axis);
|
||||||
const auto concat4 = std::make_shared<opset1::Concat>(NodeVector{A, B}, params.axis);
|
const auto concat4 = std::make_shared<op::v0::Concat>(NodeVector{A, B}, params.axis);
|
||||||
const auto concat12 = std::make_shared<opset1::Concat>(NodeVector{concat1, concat2}, params.axis);
|
const auto concat12 = std::make_shared<op::v0::Concat>(NodeVector{concat1, concat2}, params.axis);
|
||||||
const auto concat34 = std::make_shared<opset1::Concat>(NodeVector{concat3, concat4}, params.axis);
|
const auto concat34 = std::make_shared<op::v0::Concat>(NodeVector{concat3, concat4}, params.axis);
|
||||||
const auto concat14 = std::make_shared<opset1::Concat>(NodeVector{concat12, concat34}, params.axis);
|
const auto concat14 = std::make_shared<op::v0::Concat>(NodeVector{concat12, concat34}, params.axis);
|
||||||
const auto f =
|
const auto f =
|
||||||
std::make_shared<Model>(std::make_shared<opset1::Add>(concat14, concat14), ParameterVector{A, B});
|
std::make_shared<Model>(std::make_shared<op::v1::Add>(concat14, concat14), ParameterVector{A, B});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -848,12 +853,12 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ConcatParamsInPlaceAddConcat& params) {
|
static std::shared_ptr<Model> CreateFunction(const ConcatParamsInPlaceAddConcat& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
const auto add1 = std::make_shared<opset1::Add>(A, B);
|
const auto add1 = std::make_shared<op::v1::Add>(A, B);
|
||||||
const auto add2 = std::make_shared<opset1::Add>(add1, add1);
|
const auto add2 = std::make_shared<op::v1::Add>(add1, add1);
|
||||||
const auto concat = std::make_shared<opset1::Concat>(NodeVector{add1, add2}, params.axis);
|
const auto concat = std::make_shared<op::v0::Concat>(NodeVector{add1, add2}, params.axis);
|
||||||
const auto add3 = std::make_shared<opset1::Add>(concat, concat);
|
const auto add3 = std::make_shared<op::v1::Add>(concat, concat);
|
||||||
const auto f = std::make_shared<Model>(add3, ParameterVector{A, B});
|
const auto f = std::make_shared<Model>(add3, ParameterVector{A, B});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -950,16 +955,16 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ConcatParamsInPlaceAddConcat2& params) {
|
static std::shared_ptr<Model> CreateFunction(const ConcatParamsInPlaceAddConcat2& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
const auto add1 = std::make_shared<opset1::Add>(A, B);
|
const auto add1 = std::make_shared<op::v1::Add>(A, B);
|
||||||
const auto add2 = std::make_shared<opset1::Add>(A, B);
|
const auto add2 = std::make_shared<op::v1::Add>(A, B);
|
||||||
const auto add3 = std::make_shared<opset1::Add>(A, B);
|
const auto add3 = std::make_shared<op::v1::Add>(A, B);
|
||||||
const auto add4 = std::make_shared<opset1::Add>(A, B);
|
const auto add4 = std::make_shared<op::v1::Add>(A, B);
|
||||||
const auto add5 = std::make_shared<opset1::Add>(A, B);
|
const auto add5 = std::make_shared<op::v1::Add>(A, B);
|
||||||
const auto concat1 = std::make_shared<opset1::Concat>(NodeVector{add1, add2, add3}, params.axis);
|
const auto concat1 = std::make_shared<op::v0::Concat>(NodeVector{add1, add2, add3}, params.axis);
|
||||||
const auto concat2 = std::make_shared<opset1::Concat>(NodeVector{add4, add2, add5}, params.axis);
|
const auto concat2 = std::make_shared<op::v0::Concat>(NodeVector{add4, add2, add5}, params.axis);
|
||||||
const auto add6 = std::make_shared<opset1::Add>(concat1, concat2);
|
const auto add6 = std::make_shared<op::v1::Add>(concat1, concat2);
|
||||||
const auto f = std::make_shared<Model>(add6, ParameterVector{A, B});
|
const auto f = std::make_shared<Model>(add6, ParameterVector{A, B});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -1061,10 +1066,10 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ConcatParams5d& params) {
|
static std::shared_ptr<Model> CreateFunction(const ConcatParams5d& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
const auto C = std::make_shared<opset1::Parameter>(params.C.type, params.C.shape);
|
const auto C = std::make_shared<op::v0::Parameter>(params.C.type, params.C.shape);
|
||||||
const auto concat = std::make_shared<opset1::Concat>(NodeVector{A, B, C}, params.axis);
|
const auto concat = std::make_shared<op::v0::Concat>(NodeVector{A, B, C}, params.axis);
|
||||||
const auto f = std::make_shared<Model>(concat, ParameterVector{A, B, C});
|
const auto f = std::make_shared<Model>(concat, ParameterVector{A, B, C});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -1210,9 +1215,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ConcatParamsZeroLength1dLast& params) {
|
static std::shared_ptr<Model> CreateFunction(const ConcatParamsZeroLength1dLast& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
const auto concat = std::make_shared<opset1::Concat>(NodeVector{A, B}, params.axis);
|
const auto concat = std::make_shared<op::v0::Concat>(NodeVector{A, B}, params.axis);
|
||||||
const auto f = std::make_shared<Model>(concat, ParameterVector{A, B});
|
const auto f = std::make_shared<Model>(concat, ParameterVector{A, B});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -1314,10 +1319,10 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ConcatParamsZeroLength1dMiddle& params) {
|
static std::shared_ptr<Model> CreateFunction(const ConcatParamsZeroLength1dMiddle& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
const auto C = std::make_shared<opset1::Parameter>(params.C.type, params.C.shape);
|
const auto C = std::make_shared<op::v0::Parameter>(params.C.type, params.C.shape);
|
||||||
const auto concat = std::make_shared<opset1::Concat>(NodeVector{A, B, C}, params.axis);
|
const auto concat = std::make_shared<op::v0::Concat>(NodeVector{A, B, C}, params.axis);
|
||||||
const auto f = std::make_shared<Model>(concat, ParameterVector{A, B, C});
|
const auto f = std::make_shared<Model>(concat, ParameterVector{A, B, C});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -1409,8 +1414,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ConcatParamsZeroZero& params) {
|
static std::shared_ptr<Model> CreateFunction(const ConcatParamsZeroZero& params) {
|
||||||
const auto constant_1 = std::make_shared<opset1::Constant>(params.A.type, params.A.shape, params.A.data.data());
|
const auto constant_1 = std::make_shared<op::v0::Constant>(params.A.type, params.A.shape, params.A.data.data());
|
||||||
const auto concat_1 = std::make_shared<opset1::Concat>(NodeVector{constant_1, constant_1}, params.axis);
|
const auto concat_1 = std::make_shared<op::v0::Concat>(NodeVector{constant_1, constant_1}, params.axis);
|
||||||
const auto f = std::make_shared<Model>(concat_1, ParameterVector{});
|
const auto f = std::make_shared<Model>(concat_1, ParameterVector{});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -1511,10 +1516,10 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ConcatParamsZeroLength4dMiddle& params) {
|
static std::shared_ptr<Model> CreateFunction(const ConcatParamsZeroLength4dMiddle& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
const auto C = std::make_shared<opset1::Parameter>(params.C.type, params.C.shape);
|
const auto C = std::make_shared<op::v0::Parameter>(params.C.type, params.C.shape);
|
||||||
const auto concat = std::make_shared<opset1::Concat>(NodeVector{A, B, C}, params.axis);
|
const auto concat = std::make_shared<op::v0::Concat>(NodeVector{A, B, C}, params.axis);
|
||||||
const auto f = std::make_shared<Model>(concat, ParameterVector{A, B, C});
|
const auto f = std::make_shared<Model>(concat, ParameterVector{A, B, C});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <openvino/core/model.hpp>
|
|
||||||
#include <openvino/op/i420_to_bgr.hpp>
|
|
||||||
#include <openvino/op/i420_to_rgb.hpp>
|
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "functional_test_utils/skip_tests_config.hpp"
|
#include "functional_test_utils/skip_tests_config.hpp"
|
||||||
|
#include "openvino/core/model.hpp"
|
||||||
|
#include "openvino/op/i420_to_bgr.hpp"
|
||||||
|
#include "openvino/op/i420_to_rgb.hpp"
|
||||||
|
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
using namespace InferenceEngine;
|
using namespace InferenceEngine;
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <openvino/core/model.hpp>
|
|
||||||
#include <openvino/op/nv12_to_bgr.hpp>
|
|
||||||
#include <openvino/op/nv12_to_rgb.hpp>
|
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "functional_test_utils/skip_tests_config.hpp"
|
#include "functional_test_utils/skip_tests_config.hpp"
|
||||||
|
#include "openvino/core/model.hpp"
|
||||||
|
#include "openvino/op/nv12_to_bgr.hpp"
|
||||||
|
#include "openvino/op/nv12_to_rgb.hpp"
|
||||||
|
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
using namespace InferenceEngine;
|
using namespace InferenceEngine;
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/deformable_psroi_pooling.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <random>
|
#include <random>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/op/psroi_pooling.hpp"
|
#include "openvino/op/psroi_pooling.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -186,7 +187,7 @@ private:
|
|||||||
const auto rois = std::make_shared<op::v0::Parameter>(params.roisType, params.roisShape);
|
const auto rois = std::make_shared<op::v0::Parameter>(params.roisType, params.roisShape);
|
||||||
if (params.offsetsShape.size() != 0) {
|
if (params.offsetsShape.size() != 0) {
|
||||||
const auto offsets = std::make_shared<op::v0::Parameter>(params.offsetsType, params.offsetsShape);
|
const auto offsets = std::make_shared<op::v0::Parameter>(params.offsetsType, params.offsetsShape);
|
||||||
const auto DeformablePSROIPooling = std::make_shared<opset1::DeformablePSROIPooling>(input,
|
const auto DeformablePSROIPooling = std::make_shared<op::v1::DeformablePSROIPooling>(input,
|
||||||
rois,
|
rois,
|
||||||
offsets,
|
offsets,
|
||||||
params.outputDim,
|
params.outputDim,
|
||||||
@ -200,7 +201,7 @@ private:
|
|||||||
return std::make_shared<ov::Model>(NodeVector{DeformablePSROIPooling},
|
return std::make_shared<ov::Model>(NodeVector{DeformablePSROIPooling},
|
||||||
ParameterVector{input, rois, offsets});
|
ParameterVector{input, rois, offsets});
|
||||||
} else {
|
} else {
|
||||||
const auto DeformablePSROIPooling = std::make_shared<opset1::DeformablePSROIPooling>(input,
|
const auto DeformablePSROIPooling = std::make_shared<op::v1::DeformablePSROIPooling>(input,
|
||||||
rois,
|
rois,
|
||||||
params.outputDim,
|
params.outputDim,
|
||||||
params.spatialScale,
|
params.spatialScale,
|
||||||
|
@ -2,10 +2,12 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/depth_to_space.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -56,11 +58,10 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const DepthToSpaceParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const DepthToSpaceParams& params) {
|
||||||
opset1::DepthToSpace::DepthToSpaceMode mode = params.mode == "DEPTH_FIRST"
|
const auto mode = params.mode == "DEPTH_FIRST" ? op::v0::DepthToSpace::DepthToSpaceMode::DEPTH_FIRST
|
||||||
? opset1::DepthToSpace::DepthToSpaceMode::DEPTH_FIRST
|
: op::v0::DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST;
|
||||||
: opset1::DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST;
|
const auto data = std::make_shared<op::v0::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
||||||
const auto data = std::make_shared<opset1::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
const auto depthToSpace = std::make_shared<op::v0::DepthToSpace>(data, mode, params.blockSize);
|
||||||
const auto depthToSpace = std::make_shared<opset1::DepthToSpace>(data, mode, params.blockSize);
|
|
||||||
return std::make_shared<Model>(NodeVector{depthToSpace}, ParameterVector{data});
|
return std::make_shared<Model>(NodeVector{depthToSpace}, ParameterVector{data});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -2,11 +2,12 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/einsum.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
#include "openvino/opsets/opset7.hpp"
|
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -56,11 +57,11 @@ private:
|
|||||||
OutputVector output_vector;
|
OutputVector output_vector;
|
||||||
ParameterVector param_vector;
|
ParameterVector param_vector;
|
||||||
for (const auto& input_tensor : params.inputs) {
|
for (const auto& input_tensor : params.inputs) {
|
||||||
auto param = std::make_shared<opset1::Parameter>(input_tensor.type, input_tensor.shape);
|
auto param = std::make_shared<op::v0::Parameter>(input_tensor.type, input_tensor.shape);
|
||||||
output_vector.push_back(param);
|
output_vector.push_back(param);
|
||||||
param_vector.push_back(param);
|
param_vector.push_back(param);
|
||||||
}
|
}
|
||||||
const auto einsum = std::make_shared<opset7::Einsum>(output_vector, params.equation);
|
const auto einsum = std::make_shared<op::v7::Einsum>(output_vector, params.equation);
|
||||||
const auto f = std::make_shared<Model>(OutputVector{einsum}, param_vector);
|
const auto f = std::make_shared<Model>(OutputVector{einsum}, param_vector);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,8 @@
|
|||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <shared_test_classes/base/layer_test_utils.hpp>
|
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
|
#include "shared_test_classes/base/layer_test_utils.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
|
@ -4,9 +4,8 @@
|
|||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <shared_test_classes/base/layer_test_utils.hpp>
|
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
|
#include "shared_test_classes/base/layer_test_utils.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
|
@ -4,9 +4,8 @@
|
|||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <shared_test_classes/base/layer_test_utils.hpp>
|
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
|
#include "shared_test_classes/base/layer_test_utils.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/extractimagepatches.hpp"
|
||||||
#include "openvino/opsets/opset3.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -61,8 +61,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateModel(const ExtractImagePatchesParams& params) {
|
static std::shared_ptr<Model> CreateModel(const ExtractImagePatchesParams& params) {
|
||||||
const auto data = std::make_shared<opset1::Parameter>(params.data.type, params.data.shape);
|
const auto data = std::make_shared<op::v0::Parameter>(params.data.type, params.data.shape);
|
||||||
const auto extrace_image_patches = std::make_shared<opset3::ExtractImagePatches>(data,
|
const auto extrace_image_patches = std::make_shared<op::v3::ExtractImagePatches>(data,
|
||||||
params.sizes,
|
params.sizes,
|
||||||
params.strides,
|
params.strides,
|
||||||
params.rates,
|
params.rates,
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/gather.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/constant.hpp"
|
||||||
#include "openvino/opsets/opset7.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
#include "openvino/opsets/opset8.hpp"
|
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -62,11 +63,11 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const GatherParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const GatherParams& params) {
|
||||||
const auto P = std::make_shared<opset1::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
const auto P = std::make_shared<op::v0::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
||||||
const auto I = std::make_shared<opset1::Parameter>(params.indicesTensor.type, params.indicesTensor.shape);
|
const auto I = std::make_shared<op::v0::Parameter>(params.indicesTensor.type, params.indicesTensor.shape);
|
||||||
const auto A =
|
const auto A =
|
||||||
opset1::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data());
|
op::v0::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data());
|
||||||
const auto G = std::make_shared<opset1::Gather>(P, I, A);
|
const auto G = std::make_shared<op::v1::Gather>(P, I, A);
|
||||||
const auto f = std::make_shared<Model>(G, ParameterVector{P, I});
|
const auto f = std::make_shared<Model>(G, ParameterVector{P, I});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -129,11 +130,11 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const GatherParamsV7& params) {
|
static std::shared_ptr<Model> CreateFunction(const GatherParamsV7& params) {
|
||||||
const auto P = std::make_shared<opset1::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
const auto P = std::make_shared<op::v0::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
||||||
const auto I = std::make_shared<opset1::Parameter>(params.indicesTensor.type, params.indicesTensor.shape);
|
const auto I = std::make_shared<op::v0::Parameter>(params.indicesTensor.type, params.indicesTensor.shape);
|
||||||
const auto A =
|
const auto A =
|
||||||
opset1::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data());
|
op::v0::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data());
|
||||||
const auto G = std::make_shared<opset7::Gather>(P, I, A, params.batchDims);
|
const auto G = std::make_shared<op::v7::Gather>(P, I, A, params.batchDims);
|
||||||
const auto f = std::make_shared<Model>(G, ParameterVector{P, I});
|
const auto f = std::make_shared<Model>(G, ParameterVector{P, I});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -146,11 +147,11 @@ TEST_P(ReferenceGatherTestV7, CompareWithRefs) {
|
|||||||
class ReferenceGatherTestV8 : public ReferenceGatherTestV7 {
|
class ReferenceGatherTestV8 : public ReferenceGatherTestV7 {
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const GatherParamsV7& params) {
|
static std::shared_ptr<Model> CreateFunction(const GatherParamsV7& params) {
|
||||||
const auto P = std::make_shared<opset1::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
const auto P = std::make_shared<op::v0::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
||||||
const auto I = std::make_shared<opset1::Parameter>(params.indicesTensor.type, params.indicesTensor.shape);
|
const auto I = std::make_shared<op::v0::Parameter>(params.indicesTensor.type, params.indicesTensor.shape);
|
||||||
const auto A =
|
const auto A =
|
||||||
opset1::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data());
|
op::v0::Constant::create(params.axisTensor.type, params.axisTensor.shape, params.axisTensor.data.data());
|
||||||
const auto G = std::make_shared<opset8::Gather>(P, I, A, params.batchDims);
|
const auto G = std::make_shared<op::v8::Gather>(P, I, A, params.batchDims);
|
||||||
const auto f = std::make_shared<Model>(G, ParameterVector{P, I});
|
const auto f = std::make_shared<Model>(G, ParameterVector{P, I});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,12 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/gather_tree.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -59,11 +61,11 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const GatherTreeParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const GatherTreeParams& params) {
|
||||||
const auto step_ids = std::make_shared<opset1::Parameter>(params.stepIds.type, params.stepIds.shape);
|
const auto step_ids = std::make_shared<op::v0::Parameter>(params.stepIds.type, params.stepIds.shape);
|
||||||
const auto parent_idx = std::make_shared<opset1::Parameter>(params.parentIdx.type, params.parentIdx.shape);
|
const auto parent_idx = std::make_shared<op::v0::Parameter>(params.parentIdx.type, params.parentIdx.shape);
|
||||||
const auto max_seq_len = std::make_shared<opset1::Parameter>(params.maxSeqLen.type, params.maxSeqLen.shape);
|
const auto max_seq_len = std::make_shared<op::v0::Parameter>(params.maxSeqLen.type, params.maxSeqLen.shape);
|
||||||
const auto end_token = std::make_shared<opset1::Parameter>(params.endToken.type, params.endToken.shape);
|
const auto end_token = std::make_shared<op::v0::Parameter>(params.endToken.type, params.endToken.shape);
|
||||||
const auto gather_tree = std::make_shared<opset1::GatherTree>(step_ids, parent_idx, max_seq_len, end_token);
|
const auto gather_tree = std::make_shared<op::v1::GatherTree>(step_ids, parent_idx, max_seq_len, end_token);
|
||||||
const auto f =
|
const auto f =
|
||||||
std::make_shared<Model>(gather_tree, ParameterVector{step_ids, parent_idx, max_seq_len, end_token});
|
std::make_shared<Model>(gather_tree, ParameterVector{step_ids, parent_idx, max_seq_len, end_token});
|
||||||
return f;
|
return f;
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
|
#include "openvino/op/constant.hpp"
|
||||||
#include "openvino/op/group_conv.hpp"
|
#include "openvino/op/group_conv.hpp"
|
||||||
#include "openvino/opsets/opset8.hpp"
|
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -187,7 +187,7 @@ private:
|
|||||||
|
|
||||||
const auto in = std::make_shared<op::v0::Parameter>(params.inType, params.inputShape);
|
const auto in = std::make_shared<op::v0::Parameter>(params.inType, params.inputShape);
|
||||||
const auto filter = std::make_shared<op::v0::Parameter>(params.inType, params.filterShape);
|
const auto filter = std::make_shared<op::v0::Parameter>(params.inType, params.filterShape);
|
||||||
auto output_shape = std::make_shared<opset8::Constant>(element::i64,
|
auto output_shape = std::make_shared<op::v0::Constant>(element::i64,
|
||||||
params.constantOutputShape,
|
params.constantOutputShape,
|
||||||
params.constantOutputShapeData);
|
params.constantOutputShapeData);
|
||||||
const auto GroupConvolutionBackpropData =
|
const auto GroupConvolutionBackpropData =
|
||||||
|
@ -5,11 +5,11 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <ie_core.hpp>
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <shared_test_classes/base/layer_test_utils.hpp>
|
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
|
#include "ie_core.hpp"
|
||||||
|
#include "shared_test_classes/base/layer_test_utils.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
|
@ -2,14 +2,19 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include "openvino/op/loop.hpp"
|
||||||
|
|
||||||
#include <openvino/core/model.hpp>
|
#include <gtest/gtest.h>
|
||||||
#include <openvino/opsets/opset8.hpp>
|
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "common_test_utils/common_utils.hpp"
|
#include "common_test_utils/common_utils.hpp"
|
||||||
#include "functional_test_utils/skip_tests_config.hpp"
|
#include "functional_test_utils/skip_tests_config.hpp"
|
||||||
|
#include "openvino/core/model.hpp"
|
||||||
|
#include "openvino/op/add.hpp"
|
||||||
|
#include "openvino/op/constant.hpp"
|
||||||
|
#include "openvino/op/multiply.hpp"
|
||||||
|
#include "openvino/op/parameter.hpp"
|
||||||
|
#include "openvino/op/result.hpp"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
enum LOOP_IN_TYPE { INVARIANT, MERGED };
|
enum LOOP_IN_TYPE { INVARIANT, MERGED };
|
||||||
@ -30,36 +35,36 @@ struct LoopDynamicInputs : public LoopFunctionalBase {
|
|||||||
const int64_t& trip_count_value,
|
const int64_t& trip_count_value,
|
||||||
const std::vector<LOOP_IN_TYPE>& loop_in_type,
|
const std::vector<LOOP_IN_TYPE>& loop_in_type,
|
||||||
const ov::element::Type& net_type) override {
|
const ov::element::Type& net_type) override {
|
||||||
auto X = std::make_shared<ov::opset8::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
auto X = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
||||||
auto Y = std::make_shared<ov::opset8::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
auto Y = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
||||||
auto M = std::make_shared<ov::opset8::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
auto M = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
||||||
|
|
||||||
// Set up the cell body, a function from (Xi, Yi) -> (Zo)
|
// Set up the cell body, a function from (Xi, Yi) -> (Zo)
|
||||||
// Body parameters
|
// Body parameters
|
||||||
auto Xi = std::make_shared<ov::opset8::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
auto Xi = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
||||||
auto Yi = std::make_shared<ov::opset8::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
auto Yi = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
||||||
auto M_body = std::make_shared<ov::opset8::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
auto M_body = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
||||||
auto body_condition = std::make_shared<ov::opset8::Constant>(ov::element::boolean, ov::Shape{1}, true);
|
auto body_condition = std::make_shared<ov::op::v0::Constant>(ov::element::boolean, ov::Shape{1}, true);
|
||||||
|
|
||||||
auto trip_count = std::make_shared<ov::opset8::Constant>(ov::element::i64, ov::Shape{1}, 3);
|
auto trip_count = std::make_shared<ov::op::v0::Constant>(ov::element::i64, ov::Shape{1}, 3);
|
||||||
auto exec_condition = std::make_shared<ov::opset8::Constant>(ov::element::boolean, ov::Shape{1}, true);
|
auto exec_condition = std::make_shared<ov::op::v0::Constant>(ov::element::boolean, ov::Shape{1}, true);
|
||||||
// Body
|
// Body
|
||||||
auto sum = std::make_shared<ov::opset8::Add>(Xi, Yi);
|
auto sum = std::make_shared<ov::op::v1::Add>(Xi, Yi);
|
||||||
auto Zo = std::make_shared<ov::opset8::Multiply>(sum, M_body);
|
auto Zo = std::make_shared<ov::op::v1::Multiply>(sum, M_body);
|
||||||
auto body =
|
auto body =
|
||||||
std::make_shared<ov::Model>(ov::OutputVector{body_condition, Zo}, ov::ParameterVector{Xi, Yi, M_body});
|
std::make_shared<ov::Model>(ov::OutputVector{body_condition, Zo}, ov::ParameterVector{Xi, Yi, M_body});
|
||||||
|
|
||||||
auto loop = std::make_shared<ov::opset8::Loop>(trip_count, exec_condition);
|
auto loop = std::make_shared<ov::op::v5::Loop>(trip_count, exec_condition);
|
||||||
loop->set_function(body);
|
loop->set_function(body);
|
||||||
|
|
||||||
loop->set_invariant_input(Xi, X);
|
loop->set_invariant_input(Xi, X);
|
||||||
loop->set_invariant_input(Yi, Y);
|
loop->set_invariant_input(Yi, Y);
|
||||||
loop->set_merged_input(M_body, M, Zo);
|
loop->set_merged_input(M_body, M, Zo);
|
||||||
|
|
||||||
loop->set_special_body_ports(ov::opset8::Loop::SpecialBodyPorts{-1, 0});
|
loop->set_special_body_ports(ov::op::v5::Loop::SpecialBodyPorts{-1, 0});
|
||||||
|
|
||||||
// Output is last Zo
|
// Output is last Zo
|
||||||
auto result = std::make_shared<ov::opset8::Result>(loop->get_iter_value(Zo, -1));
|
auto result = std::make_shared<ov::op::v0::Result>(loop->get_iter_value(Zo, -1));
|
||||||
return std::make_shared<ov::Model>(ov::ResultVector{result}, ov::ParameterVector{X, Y, M});
|
return std::make_shared<ov::Model>(ov::ResultVector{result}, ov::ParameterVector{X, Y, M});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -131,7 +136,7 @@ struct LoopStaticInputs : public LoopFunctionalBase {
|
|||||||
const ov::element::Type& net_type) override {
|
const ov::element::Type& net_type) override {
|
||||||
ov::ParameterVector loop_params;
|
ov::ParameterVector loop_params;
|
||||||
for (auto&& input : loop_inputs) {
|
for (auto&& input : loop_inputs) {
|
||||||
loop_params.emplace_back(std::make_shared<ov::opset8::Parameter>(input.type, input.shape));
|
loop_params.emplace_back(std::make_shared<ov::op::v0::Parameter>(input.type, input.shape));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up the cell body, a function from (Xi, Yi) -> (Zo)
|
// Set up the cell body, a function from (Xi, Yi) -> (Zo)
|
||||||
@ -139,26 +144,26 @@ struct LoopStaticInputs : public LoopFunctionalBase {
|
|||||||
const std::vector<ov::PartialShape> body_params_shapes(loop_inputs.size(), ov::PartialShape::dynamic());
|
const std::vector<ov::PartialShape> body_params_shapes(loop_inputs.size(), ov::PartialShape::dynamic());
|
||||||
ov::ParameterVector body_params;
|
ov::ParameterVector body_params;
|
||||||
for (const auto& pshape : body_params_shapes) {
|
for (const auto& pshape : body_params_shapes) {
|
||||||
body_params.emplace_back(std::make_shared<ov::opset8::Parameter>(net_type, pshape));
|
body_params.emplace_back(std::make_shared<ov::op::v0::Parameter>(net_type, pshape));
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto body_condition_const =
|
const auto body_condition_const =
|
||||||
std::make_shared<ov::opset8::Constant>(ov::element::boolean, ov::Shape{1}, true);
|
std::make_shared<ov::op::v0::Constant>(ov::element::boolean, ov::Shape{1}, true);
|
||||||
const auto exec_condition = std::make_shared<ov::opset8::Constant>(ov::element::boolean, ov::Shape{1}, true);
|
const auto exec_condition = std::make_shared<ov::op::v0::Constant>(ov::element::boolean, ov::Shape{1}, true);
|
||||||
std::shared_ptr<ov::Node> trip_count_input;
|
std::shared_ptr<ov::Node> trip_count_input;
|
||||||
trip_count_input = std::make_shared<ov::opset8::Constant>(ov::element::i64, ov::Shape{1}, trip_count);
|
trip_count_input = std::make_shared<ov::op::v0::Constant>(ov::element::i64, ov::Shape{1}, trip_count);
|
||||||
|
|
||||||
// Body
|
// Body
|
||||||
std::shared_ptr<ov::Node> Zo = body_params[0];
|
std::shared_ptr<ov::Node> Zo = body_params[0];
|
||||||
for (size_t i = 1; i < body_params.size(); ++i) {
|
for (size_t i = 1; i < body_params.size(); ++i) {
|
||||||
Zo = std::make_shared<ov::opset8::Add>(body_params[i], Zo);
|
Zo = std::make_shared<ov::op::v1::Add>(body_params[i], Zo);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto body = std::make_shared<ov::Model>(ov::OutputVector{body_condition_const, Zo}, body_params);
|
const auto body = std::make_shared<ov::Model>(ov::OutputVector{body_condition_const, Zo}, body_params);
|
||||||
|
|
||||||
const auto loop = std::make_shared<ov::opset8::Loop>(trip_count_input, exec_condition);
|
const auto loop = std::make_shared<ov::op::v5::Loop>(trip_count_input, exec_condition);
|
||||||
loop->set_function(body);
|
loop->set_function(body);
|
||||||
loop->set_special_body_ports(ov::opset8::Loop::SpecialBodyPorts{-1, 0});
|
loop->set_special_body_ports(ov::op::v5::Loop::SpecialBodyPorts{-1, 0});
|
||||||
|
|
||||||
for (size_t i = 0; i < body_params.size(); ++i) {
|
for (size_t i = 0; i < body_params.size(); ++i) {
|
||||||
if (loop_in_type[i] == LOOP_IN_TYPE::INVARIANT) {
|
if (loop_in_type[i] == LOOP_IN_TYPE::INVARIANT) {
|
||||||
@ -177,9 +182,9 @@ struct LoopStaticInputs : public LoopFunctionalBase {
|
|||||||
// start=0, stride=1, part_size=1, end=-1, axis=1
|
// start=0, stride=1, part_size=1, end=-1, axis=1
|
||||||
const auto out2 = loop->get_concatenated_slices(Zo, 0, 1, 1, -1, 1);
|
const auto out2 = loop->get_concatenated_slices(Zo, 0, 1, 1, -1, 1);
|
||||||
|
|
||||||
const auto result0 = std::make_shared<ov::opset8::Result>(out0);
|
const auto result0 = std::make_shared<ov::op::v0::Result>(out0);
|
||||||
const auto result1 = std::make_shared<ov::opset8::Result>(out1);
|
const auto result1 = std::make_shared<ov::op::v0::Result>(out1);
|
||||||
const auto result2 = std::make_shared<ov::opset8::Result>(out2);
|
const auto result2 = std::make_shared<ov::op::v0::Result>(out2);
|
||||||
const auto function =
|
const auto function =
|
||||||
std::make_shared<ov::Model>(ov::ResultVector{result0, result1, result2}, loop_params, "loop");
|
std::make_shared<ov::Model>(ov::ResultVector{result0, result1, result2}, loop_params, "loop");
|
||||||
return function;
|
return function;
|
||||||
|
@ -2,11 +2,12 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/lstm_cell.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
#include "openvino/opsets/opset4.hpp"
|
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -84,15 +85,15 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const LSTMCellParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const LSTMCellParams& params) {
|
||||||
const auto X = std::make_shared<opset1::Parameter>(params.X.type, params.X.shape);
|
const auto X = std::make_shared<op::v0::Parameter>(params.X.type, params.X.shape);
|
||||||
const auto W = std::make_shared<opset1::Parameter>(params.W.type, params.W.shape);
|
const auto W = std::make_shared<op::v0::Parameter>(params.W.type, params.W.shape);
|
||||||
const auto R = std::make_shared<opset1::Parameter>(params.R.type, params.R.shape);
|
const auto R = std::make_shared<op::v0::Parameter>(params.R.type, params.R.shape);
|
||||||
const auto H_t = std::make_shared<opset1::Parameter>(params.H_t.type, params.H_t.shape);
|
const auto H_t = std::make_shared<op::v0::Parameter>(params.H_t.type, params.H_t.shape);
|
||||||
const auto C_t = std::make_shared<opset1::Parameter>(params.C_t.type, params.C_t.shape);
|
const auto C_t = std::make_shared<op::v0::Parameter>(params.C_t.type, params.C_t.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
|
|
||||||
const auto lstm_cell =
|
const auto lstm_cell =
|
||||||
std::make_shared<opset4::LSTMCell>(X,
|
std::make_shared<op::v4::LSTMCell>(X,
|
||||||
H_t,
|
H_t,
|
||||||
C_t,
|
C_t,
|
||||||
op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC),
|
op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC),
|
||||||
@ -117,15 +118,15 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const LSTMCellParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const LSTMCellParams& params) {
|
||||||
const auto X = std::make_shared<opset1::Parameter>(params.X.type, params.X.shape);
|
const auto X = std::make_shared<op::v0::Parameter>(params.X.type, params.X.shape);
|
||||||
const auto W = std::make_shared<opset1::Parameter>(params.W.type, params.W.shape);
|
const auto W = std::make_shared<op::v0::Parameter>(params.W.type, params.W.shape);
|
||||||
const auto R = std::make_shared<opset1::Parameter>(params.R.type, params.R.shape);
|
const auto R = std::make_shared<op::v0::Parameter>(params.R.type, params.R.shape);
|
||||||
const auto H_t = std::make_shared<opset1::Parameter>(params.H_t.type, params.H_t.shape);
|
const auto H_t = std::make_shared<op::v0::Parameter>(params.H_t.type, params.H_t.shape);
|
||||||
const auto C_t = std::make_shared<opset1::Parameter>(params.C_t.type, params.C_t.shape);
|
const auto C_t = std::make_shared<op::v0::Parameter>(params.C_t.type, params.C_t.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
|
|
||||||
const auto lstm_cell =
|
const auto lstm_cell =
|
||||||
std::make_shared<opset4::LSTMCell>(X,
|
std::make_shared<op::v4::LSTMCell>(X,
|
||||||
H_t,
|
H_t,
|
||||||
C_t,
|
C_t,
|
||||||
op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC),
|
op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC),
|
||||||
@ -152,14 +153,14 @@ private:
|
|||||||
static std::shared_ptr<Model> CreateFunction(const LSTMCellParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const LSTMCellParams& params) {
|
||||||
const float clip_threshold = 3.5f;
|
const float clip_threshold = 3.5f;
|
||||||
|
|
||||||
const auto X = std::make_shared<opset1::Parameter>(params.X.type, params.X.shape);
|
const auto X = std::make_shared<op::v0::Parameter>(params.X.type, params.X.shape);
|
||||||
const auto W = std::make_shared<opset1::Parameter>(params.W.type, params.W.shape);
|
const auto W = std::make_shared<op::v0::Parameter>(params.W.type, params.W.shape);
|
||||||
const auto R = std::make_shared<opset1::Parameter>(params.R.type, params.R.shape);
|
const auto R = std::make_shared<op::v0::Parameter>(params.R.type, params.R.shape);
|
||||||
const auto H_t = std::make_shared<opset1::Parameter>(params.H_t.type, params.H_t.shape);
|
const auto H_t = std::make_shared<op::v0::Parameter>(params.H_t.type, params.H_t.shape);
|
||||||
const auto C_t = std::make_shared<opset1::Parameter>(params.C_t.type, params.C_t.shape);
|
const auto C_t = std::make_shared<op::v0::Parameter>(params.C_t.type, params.C_t.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
|
|
||||||
const auto lstm_cell = std::make_shared<opset4::LSTMCell>(X,
|
const auto lstm_cell = std::make_shared<op::v4::LSTMCell>(X,
|
||||||
H_t,
|
H_t,
|
||||||
C_t,
|
C_t,
|
||||||
W,
|
W,
|
||||||
@ -191,15 +192,15 @@ TEST_P(ReferenceLSTMCellTestBiasClip, CompareWithRefs) {
|
|||||||
class ReferenceLSTMCellV1Test : public ReferenceLSTMCellTest {
|
class ReferenceLSTMCellV1Test : public ReferenceLSTMCellTest {
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const LSTMCellParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const LSTMCellParams& params) {
|
||||||
const auto X = std::make_shared<opset1::Parameter>(params.X.type, params.X.shape);
|
const auto X = std::make_shared<op::v0::Parameter>(params.X.type, params.X.shape);
|
||||||
const auto W = std::make_shared<opset1::Parameter>(params.W.type, params.W.shape);
|
const auto W = std::make_shared<op::v0::Parameter>(params.W.type, params.W.shape);
|
||||||
const auto R = std::make_shared<opset1::Parameter>(params.R.type, params.R.shape);
|
const auto R = std::make_shared<op::v0::Parameter>(params.R.type, params.R.shape);
|
||||||
const auto H_t = std::make_shared<opset1::Parameter>(params.H_t.type, params.H_t.shape);
|
const auto H_t = std::make_shared<op::v0::Parameter>(params.H_t.type, params.H_t.shape);
|
||||||
const auto C_t = std::make_shared<opset1::Parameter>(params.C_t.type, params.C_t.shape);
|
const auto C_t = std::make_shared<op::v0::Parameter>(params.C_t.type, params.C_t.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
|
|
||||||
const auto lstm_cell =
|
const auto lstm_cell =
|
||||||
std::make_shared<opset1::LSTMCell>(X,
|
std::make_shared<op::v0::LSTMCell>(X,
|
||||||
H_t,
|
H_t,
|
||||||
C_t,
|
C_t,
|
||||||
op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC),
|
op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC),
|
||||||
@ -215,15 +216,15 @@ private:
|
|||||||
class ReferenceLSTMCellV1TestBiasDefaultAttrs : public ReferenceLSTMCellTestBiasDefaultAttrs {
|
class ReferenceLSTMCellV1TestBiasDefaultAttrs : public ReferenceLSTMCellTestBiasDefaultAttrs {
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const LSTMCellParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const LSTMCellParams& params) {
|
||||||
const auto X = std::make_shared<opset1::Parameter>(params.X.type, params.X.shape);
|
const auto X = std::make_shared<op::v0::Parameter>(params.X.type, params.X.shape);
|
||||||
const auto W = std::make_shared<opset1::Parameter>(params.W.type, params.W.shape);
|
const auto W = std::make_shared<op::v0::Parameter>(params.W.type, params.W.shape);
|
||||||
const auto R = std::make_shared<opset1::Parameter>(params.R.type, params.R.shape);
|
const auto R = std::make_shared<op::v0::Parameter>(params.R.type, params.R.shape);
|
||||||
const auto H_t = std::make_shared<opset1::Parameter>(params.H_t.type, params.H_t.shape);
|
const auto H_t = std::make_shared<op::v0::Parameter>(params.H_t.type, params.H_t.shape);
|
||||||
const auto C_t = std::make_shared<opset1::Parameter>(params.C_t.type, params.C_t.shape);
|
const auto C_t = std::make_shared<op::v0::Parameter>(params.C_t.type, params.C_t.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
|
|
||||||
const auto lstm_cell =
|
const auto lstm_cell =
|
||||||
std::make_shared<opset1::LSTMCell>(X,
|
std::make_shared<op::v0::LSTMCell>(X,
|
||||||
H_t,
|
H_t,
|
||||||
C_t,
|
C_t,
|
||||||
op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC),
|
op::util::convert_lstm_node_format(W, op::util::LSTMWeightsFormat::IOFC),
|
||||||
@ -256,15 +257,15 @@ private:
|
|||||||
static std::shared_ptr<Model> CreateFunction(const LSTMCellParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const LSTMCellParams& params) {
|
||||||
const float clip_threshold = 3.5f;
|
const float clip_threshold = 3.5f;
|
||||||
|
|
||||||
const auto X = std::make_shared<opset1::Parameter>(params.X.type, params.X.shape);
|
const auto X = std::make_shared<op::v0::Parameter>(params.X.type, params.X.shape);
|
||||||
const auto W = std::make_shared<opset1::Parameter>(params.W.type, params.W.shape);
|
const auto W = std::make_shared<op::v0::Parameter>(params.W.type, params.W.shape);
|
||||||
const auto R = std::make_shared<opset1::Parameter>(params.R.type, params.R.shape);
|
const auto R = std::make_shared<op::v0::Parameter>(params.R.type, params.R.shape);
|
||||||
const auto H_t = std::make_shared<opset1::Parameter>(params.H_t.type, params.H_t.shape);
|
const auto H_t = std::make_shared<op::v0::Parameter>(params.H_t.type, params.H_t.shape);
|
||||||
const auto C_t = std::make_shared<opset1::Parameter>(params.C_t.type, params.C_t.shape);
|
const auto C_t = std::make_shared<op::v0::Parameter>(params.C_t.type, params.C_t.shape);
|
||||||
const auto B = std::make_shared<opset1::Parameter>(params.B.type, params.B.shape);
|
const auto B = std::make_shared<op::v0::Parameter>(params.B.type, params.B.shape);
|
||||||
const auto P = std::make_shared<opset1::Parameter>(params.P.type, params.P.shape);
|
const auto P = std::make_shared<op::v0::Parameter>(params.P.type, params.P.shape);
|
||||||
|
|
||||||
const auto lstm_cell = std::make_shared<opset1::LSTMCell>(X,
|
const auto lstm_cell = std::make_shared<op::v0::LSTMCell>(X,
|
||||||
H_t,
|
H_t,
|
||||||
C_t,
|
C_t,
|
||||||
W,
|
W,
|
||||||
|
@ -2,18 +2,19 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/matrix_nms.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
#include "openvino/opsets/opset8.hpp"
|
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct MatrixNmsParams {
|
struct MatrixNmsParams {
|
||||||
MatrixNmsParams(const opset8::MatrixNms::Attributes& attrs,
|
MatrixNmsParams(const op::v8::MatrixNms::Attributes& attrs,
|
||||||
const reference_tests::Tensor& boxes,
|
const reference_tests::Tensor& boxes,
|
||||||
const reference_tests::Tensor& scores,
|
const reference_tests::Tensor& scores,
|
||||||
const reference_tests::Tensor& expectedSelectedScores,
|
const reference_tests::Tensor& expectedSelectedScores,
|
||||||
@ -28,7 +29,7 @@ struct MatrixNmsParams {
|
|||||||
expectedValidOutputs(expectedValidOutputs),
|
expectedValidOutputs(expectedValidOutputs),
|
||||||
testcaseName(testcaseName) {}
|
testcaseName(testcaseName) {}
|
||||||
|
|
||||||
opset8::MatrixNms::Attributes attrs;
|
op::v8::MatrixNms::Attributes attrs;
|
||||||
reference_tests::Tensor boxes;
|
reference_tests::Tensor boxes;
|
||||||
reference_tests::Tensor scores;
|
reference_tests::Tensor scores;
|
||||||
reference_tests::Tensor expectedSelectedScores;
|
reference_tests::Tensor expectedSelectedScores;
|
||||||
@ -71,9 +72,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const MatrixNmsParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const MatrixNmsParams& params) {
|
||||||
const auto boxes = std::make_shared<opset1::Parameter>(params.boxes.type, PartialShape::dynamic());
|
const auto boxes = std::make_shared<op::v0::Parameter>(params.boxes.type, PartialShape::dynamic());
|
||||||
const auto scores = std::make_shared<opset1::Parameter>(params.scores.type, PartialShape::dynamic());
|
const auto scores = std::make_shared<op::v0::Parameter>(params.scores.type, PartialShape::dynamic());
|
||||||
const auto nms = std::make_shared<opset8::MatrixNms>(boxes, scores, params.attrs);
|
const auto nms = std::make_shared<op::v8::MatrixNms>(boxes, scores, params.attrs);
|
||||||
const auto f = std::make_shared<Model>(nms->outputs(), ParameterVector{boxes, scores});
|
const auto f = std::make_shared<Model>(nms->outputs(), ParameterVector{boxes, scores});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -91,14 +92,14 @@ std::vector<MatrixNmsParams> generateParams() {
|
|||||||
std::vector<MatrixNmsParams> params{
|
std::vector<MatrixNmsParams> params{
|
||||||
MatrixNmsParams(
|
MatrixNmsParams(
|
||||||
{
|
{
|
||||||
opset8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
||||||
false, // sort_result_across_batch
|
false, // sort_result_across_batch
|
||||||
ET_IND, // output_type
|
ET_IND, // output_type
|
||||||
0.0f, // score_threshold
|
0.0f, // score_threshold
|
||||||
3, // nms_top_k
|
3, // nms_top_k
|
||||||
-1, // keep_top_k
|
-1, // keep_top_k
|
||||||
0, // background_class
|
0, // background_class
|
||||||
opset8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
||||||
2.0f, // gaussian_sigma
|
2.0f, // gaussian_sigma
|
||||||
0.0f, // post_threshold
|
0.0f, // post_threshold
|
||||||
true, // normalized
|
true, // normalized
|
||||||
@ -135,14 +136,14 @@ std::vector<MatrixNmsParams> generateParams() {
|
|||||||
"matrix_nms_output_type_i64"),
|
"matrix_nms_output_type_i64"),
|
||||||
MatrixNmsParams(
|
MatrixNmsParams(
|
||||||
{
|
{
|
||||||
opset8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
||||||
false, // sort_result_across_batch
|
false, // sort_result_across_batch
|
||||||
ET_IND, // output_type
|
ET_IND, // output_type
|
||||||
0.0f, // score_threshold
|
0.0f, // score_threshold
|
||||||
3, // nms_top_k
|
3, // nms_top_k
|
||||||
-1, // keep_top_k
|
-1, // keep_top_k
|
||||||
0, // background_class
|
0, // background_class
|
||||||
opset8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
||||||
2.0f, // gaussian_sigma
|
2.0f, // gaussian_sigma
|
||||||
0.0f, // post_threshold
|
0.0f, // post_threshold
|
||||||
true, // normalized
|
true, // normalized
|
||||||
@ -179,14 +180,14 @@ std::vector<MatrixNmsParams> generateParams() {
|
|||||||
"matrix_nms_output_type_i32"),
|
"matrix_nms_output_type_i32"),
|
||||||
MatrixNmsParams(
|
MatrixNmsParams(
|
||||||
{
|
{
|
||||||
opset8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
||||||
false, // sort_result_across_batch
|
false, // sort_result_across_batch
|
||||||
ET_IND, // output_type
|
ET_IND, // output_type
|
||||||
0.0f, // score_threshold
|
0.0f, // score_threshold
|
||||||
3, // nms_top_k
|
3, // nms_top_k
|
||||||
-1, // keep_top_k
|
-1, // keep_top_k
|
||||||
0, // background_class
|
0, // background_class
|
||||||
opset8::MatrixNms::DecayFunction::GAUSSIAN, // decay_function
|
op::v8::MatrixNms::DecayFunction::GAUSSIAN, // decay_function
|
||||||
2.0f, // gaussian_sigma
|
2.0f, // gaussian_sigma
|
||||||
0.0f, // post_threshold
|
0.0f, // post_threshold
|
||||||
true, // normalized
|
true, // normalized
|
||||||
@ -223,14 +224,14 @@ std::vector<MatrixNmsParams> generateParams() {
|
|||||||
"matrix_nms_gaussian"),
|
"matrix_nms_gaussian"),
|
||||||
MatrixNmsParams(
|
MatrixNmsParams(
|
||||||
{
|
{
|
||||||
opset8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
||||||
false, // sort_result_across_batch
|
false, // sort_result_across_batch
|
||||||
ET_IND, // output_type
|
ET_IND, // output_type
|
||||||
0.0f, // score_threshold
|
0.0f, // score_threshold
|
||||||
3, // nms_top_k
|
3, // nms_top_k
|
||||||
-1, // keep_top_k
|
-1, // keep_top_k
|
||||||
0, // background_class
|
0, // background_class
|
||||||
opset8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
||||||
2.0f, // gaussian_sigma
|
2.0f, // gaussian_sigma
|
||||||
0.0f, // post_threshold
|
0.0f, // post_threshold
|
||||||
true, // normalized
|
true, // normalized
|
||||||
@ -258,14 +259,14 @@ std::vector<MatrixNmsParams> generateParams() {
|
|||||||
"matrix_nms_two_batches_two_classes"),
|
"matrix_nms_two_batches_two_classes"),
|
||||||
MatrixNmsParams(
|
MatrixNmsParams(
|
||||||
{
|
{
|
||||||
opset8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
||||||
true, // sort_result_across_batch
|
true, // sort_result_across_batch
|
||||||
ET_IND, // output_type
|
ET_IND, // output_type
|
||||||
0.0f, // score_threshold
|
0.0f, // score_threshold
|
||||||
3, // nms_top_k
|
3, // nms_top_k
|
||||||
-1, // keep_top_k
|
-1, // keep_top_k
|
||||||
-1, // background_class
|
-1, // background_class
|
||||||
opset8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
||||||
2.0f, // gaussian_sigma
|
2.0f, // gaussian_sigma
|
||||||
0.5f, // post_threshold
|
0.5f, // post_threshold
|
||||||
true, // normalized
|
true, // normalized
|
||||||
@ -296,14 +297,14 @@ std::vector<MatrixNmsParams> generateParams() {
|
|||||||
"matrix_nms_two_batches_two_classes_by_score_cross_batch"),
|
"matrix_nms_two_batches_two_classes_by_score_cross_batch"),
|
||||||
MatrixNmsParams(
|
MatrixNmsParams(
|
||||||
{
|
{
|
||||||
opset8::MatrixNms::SortResultType::CLASSID, // sort_result_type
|
op::v8::MatrixNms::SortResultType::CLASSID, // sort_result_type
|
||||||
true, // sort_result_across_batch
|
true, // sort_result_across_batch
|
||||||
ET_IND, // output_type
|
ET_IND, // output_type
|
||||||
0.0f, // score_threshold
|
0.0f, // score_threshold
|
||||||
3, // nms_top_k
|
3, // nms_top_k
|
||||||
-1, // keep_top_k
|
-1, // keep_top_k
|
||||||
-1, // background_class
|
-1, // background_class
|
||||||
opset8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
||||||
2.0f, // gaussian_sigma
|
2.0f, // gaussian_sigma
|
||||||
0.5f, // post_threshold
|
0.5f, // post_threshold
|
||||||
true, // normalized
|
true, // normalized
|
||||||
@ -334,14 +335,14 @@ std::vector<MatrixNmsParams> generateParams() {
|
|||||||
"matrix_nms_two_batches_two_classes_by_classid_cross_batch"),
|
"matrix_nms_two_batches_two_classes_by_classid_cross_batch"),
|
||||||
MatrixNmsParams(
|
MatrixNmsParams(
|
||||||
{
|
{
|
||||||
opset8::MatrixNms::SortResultType::CLASSID, // sort_result_type
|
op::v8::MatrixNms::SortResultType::CLASSID, // sort_result_type
|
||||||
false, // sort_result_across_batch
|
false, // sort_result_across_batch
|
||||||
ET_IND, // output_type
|
ET_IND, // output_type
|
||||||
0.0f, // score_threshold
|
0.0f, // score_threshold
|
||||||
3, // nms_top_k
|
3, // nms_top_k
|
||||||
3, // keep_top_k
|
3, // keep_top_k
|
||||||
0, // background_class
|
0, // background_class
|
||||||
opset8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
||||||
2.0f, // gaussian_sigma
|
2.0f, // gaussian_sigma
|
||||||
0.0f, // post_threshold
|
0.0f, // post_threshold
|
||||||
true, // normalized
|
true, // normalized
|
||||||
@ -369,14 +370,14 @@ std::vector<MatrixNmsParams> generateParams() {
|
|||||||
"matrix_nms_by_keep_top_k"),
|
"matrix_nms_by_keep_top_k"),
|
||||||
MatrixNmsParams(
|
MatrixNmsParams(
|
||||||
{
|
{
|
||||||
opset8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
||||||
false, // sort_result_across_batch
|
false, // sort_result_across_batch
|
||||||
ET_IND, // output_type
|
ET_IND, // output_type
|
||||||
0.0f, // score_threshold
|
0.0f, // score_threshold
|
||||||
3, // nms_top_k
|
3, // nms_top_k
|
||||||
-1, // keep_top_k
|
-1, // keep_top_k
|
||||||
-1, // background_class
|
-1, // background_class
|
||||||
opset8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
||||||
2.0f, // gaussian_sigma
|
2.0f, // gaussian_sigma
|
||||||
0.0f, // post_threshold
|
0.0f, // post_threshold
|
||||||
true, // normalized
|
true, // normalized
|
||||||
@ -400,14 +401,14 @@ std::vector<MatrixNmsParams> generateParams() {
|
|||||||
"matrix_nms_background"),
|
"matrix_nms_background"),
|
||||||
MatrixNmsParams(
|
MatrixNmsParams(
|
||||||
{
|
{
|
||||||
opset8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
||||||
false, // sort_result_across_batch
|
false, // sort_result_across_batch
|
||||||
ET_IND, // output_type
|
ET_IND, // output_type
|
||||||
0.0f, // score_threshold
|
0.0f, // score_threshold
|
||||||
3, // nms_top_k
|
3, // nms_top_k
|
||||||
-1, // keep_top_k
|
-1, // keep_top_k
|
||||||
-1, // background_class
|
-1, // background_class
|
||||||
opset8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
||||||
2.0f, // gaussian_sigma
|
2.0f, // gaussian_sigma
|
||||||
0.0f, // post_threshold
|
0.0f, // post_threshold
|
||||||
true, // normalized
|
true, // normalized
|
||||||
@ -442,14 +443,14 @@ std::vector<MatrixNmsParams> generateParams() {
|
|||||||
"matrix_nms_flipped_coordinates"),
|
"matrix_nms_flipped_coordinates"),
|
||||||
MatrixNmsParams(
|
MatrixNmsParams(
|
||||||
{
|
{
|
||||||
opset8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
||||||
false, // sort_result_across_batch
|
false, // sort_result_across_batch
|
||||||
ET_IND, // output_type
|
ET_IND, // output_type
|
||||||
0.0f, // score_threshold
|
0.0f, // score_threshold
|
||||||
3, // nms_top_k
|
3, // nms_top_k
|
||||||
-1, // keep_top_k
|
-1, // keep_top_k
|
||||||
-1, // background_class
|
-1, // background_class
|
||||||
opset8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
||||||
2.0f, // gaussian_sigma
|
2.0f, // gaussian_sigma
|
||||||
0.8f, // post_threshold
|
0.8f, // post_threshold
|
||||||
true, // normalized
|
true, // normalized
|
||||||
@ -468,14 +469,14 @@ std::vector<MatrixNmsParams> generateParams() {
|
|||||||
"matrix_nms_post_threshold"),
|
"matrix_nms_post_threshold"),
|
||||||
MatrixNmsParams(
|
MatrixNmsParams(
|
||||||
{
|
{
|
||||||
opset8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
||||||
false, // sort_result_across_batch
|
false, // sort_result_across_batch
|
||||||
ET_IND, // output_type
|
ET_IND, // output_type
|
||||||
0.0f, // score_threshold
|
0.0f, // score_threshold
|
||||||
3, // nms_top_k
|
3, // nms_top_k
|
||||||
-1, // keep_top_k
|
-1, // keep_top_k
|
||||||
-1, // background_class
|
-1, // background_class
|
||||||
opset8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
||||||
2.0f, // gaussian_sigma
|
2.0f, // gaussian_sigma
|
||||||
0.3f, // post_threshold
|
0.3f, // post_threshold
|
||||||
true, // normalized
|
true, // normalized
|
||||||
@ -497,14 +498,14 @@ std::vector<MatrixNmsParams> generateParams() {
|
|||||||
"matrix_nms_identical_boxes"),
|
"matrix_nms_identical_boxes"),
|
||||||
MatrixNmsParams(
|
MatrixNmsParams(
|
||||||
{
|
{
|
||||||
opset8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
||||||
false, // sort_result_across_batch
|
false, // sort_result_across_batch
|
||||||
ET_IND, // output_type
|
ET_IND, // output_type
|
||||||
0.0f, // score_threshold
|
0.0f, // score_threshold
|
||||||
2, // nms_top_k
|
2, // nms_top_k
|
||||||
-1, // keep_top_k
|
-1, // keep_top_k
|
||||||
-1, // background_class
|
-1, // background_class
|
||||||
opset8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
||||||
2.0f, // gaussian_sigma
|
2.0f, // gaussian_sigma
|
||||||
0.0f, // post_threshold
|
0.0f, // post_threshold
|
||||||
true, // normalized
|
true, // normalized
|
||||||
@ -523,14 +524,14 @@ std::vector<MatrixNmsParams> generateParams() {
|
|||||||
"matrix_nms_nms_top_k"),
|
"matrix_nms_nms_top_k"),
|
||||||
MatrixNmsParams(
|
MatrixNmsParams(
|
||||||
{
|
{
|
||||||
opset8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
||||||
false, // sort_result_across_batch
|
false, // sort_result_across_batch
|
||||||
ET_IND, // output_type
|
ET_IND, // output_type
|
||||||
0.0f, // score_threshold
|
0.0f, // score_threshold
|
||||||
3, // nms_top_k
|
3, // nms_top_k
|
||||||
-1, // keep_top_k
|
-1, // keep_top_k
|
||||||
-1, // background_class
|
-1, // background_class
|
||||||
opset8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
||||||
2.0f, // gaussian_sigma
|
2.0f, // gaussian_sigma
|
||||||
0.0f, // post_threshold
|
0.0f, // post_threshold
|
||||||
true, // normalized
|
true, // normalized
|
||||||
@ -545,14 +546,14 @@ std::vector<MatrixNmsParams> generateParams() {
|
|||||||
"matrix_nms_single_box"),
|
"matrix_nms_single_box"),
|
||||||
MatrixNmsParams(
|
MatrixNmsParams(
|
||||||
{
|
{
|
||||||
opset8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
op::v8::MatrixNms::SortResultType::SCORE, // sort_result_type
|
||||||
false, // sort_result_across_batch
|
false, // sort_result_across_batch
|
||||||
ET_IND, // output_type
|
ET_IND, // output_type
|
||||||
2.0f, // score_threshold
|
2.0f, // score_threshold
|
||||||
3, // nms_top_k
|
3, // nms_top_k
|
||||||
-1, // keep_top_k
|
-1, // keep_top_k
|
||||||
-1, // background_class
|
-1, // background_class
|
||||||
opset8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
op::v8::MatrixNms::DecayFunction::LINEAR, // decay_function
|
||||||
2.0f, // gaussian_sigma
|
2.0f, // gaussian_sigma
|
||||||
0.0f, // post_threshold
|
0.0f, // post_threshold
|
||||||
true, // normalized
|
true, // normalized
|
||||||
|
@ -2,11 +2,13 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/nms_rotated.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/constant.hpp"
|
||||||
#include "openvino/opsets/opset13.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -72,19 +74,19 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateModel(const NMSRotatedParams& params) {
|
static std::shared_ptr<Model> CreateModel(const NMSRotatedParams& params) {
|
||||||
const auto boxes = std::make_shared<opset1::Parameter>(params.boxes.type, params.boxes.shape);
|
const auto boxes = std::make_shared<op::v0::Parameter>(params.boxes.type, params.boxes.shape);
|
||||||
const auto scores = std::make_shared<opset1::Parameter>(params.scores.type, params.scores.shape);
|
const auto scores = std::make_shared<op::v0::Parameter>(params.scores.type, params.scores.shape);
|
||||||
const auto max_output_boxes_per_class =
|
const auto max_output_boxes_per_class =
|
||||||
std::make_shared<opset1::Constant>(params.maxOutputBoxesPerClass.type,
|
std::make_shared<op::v0::Constant>(params.maxOutputBoxesPerClass.type,
|
||||||
params.maxOutputBoxesPerClass.shape,
|
params.maxOutputBoxesPerClass.shape,
|
||||||
params.maxOutputBoxesPerClass.data.data());
|
params.maxOutputBoxesPerClass.data.data());
|
||||||
const auto iou_threshold = std::make_shared<opset1::Constant>(params.iouThreshold.type,
|
const auto iou_threshold = std::make_shared<op::v0::Constant>(params.iouThreshold.type,
|
||||||
params.iouThreshold.shape,
|
params.iouThreshold.shape,
|
||||||
params.iouThreshold.data.data());
|
params.iouThreshold.data.data());
|
||||||
const auto score_threshold = std::make_shared<opset1::Constant>(params.scoreThreshold.type,
|
const auto score_threshold = std::make_shared<op::v0::Constant>(params.scoreThreshold.type,
|
||||||
params.scoreThreshold.shape,
|
params.scoreThreshold.shape,
|
||||||
params.scoreThreshold.data.data());
|
params.scoreThreshold.data.data());
|
||||||
const auto nms = std::make_shared<opset13::NMSRotated>(boxes,
|
const auto nms = std::make_shared<op::v13::NMSRotated>(boxes,
|
||||||
scores,
|
scores,
|
||||||
max_output_boxes_per_class,
|
max_output_boxes_per_class,
|
||||||
iou_threshold,
|
iou_threshold,
|
||||||
@ -113,16 +115,16 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateModel(const NMSRotatedParams& params) {
|
static std::shared_ptr<Model> CreateModel(const NMSRotatedParams& params) {
|
||||||
const auto boxes = std::make_shared<opset1::Parameter>(params.boxes.type, params.boxes.shape);
|
const auto boxes = std::make_shared<op::v0::Parameter>(params.boxes.type, params.boxes.shape);
|
||||||
const auto scores = std::make_shared<opset1::Parameter>(params.scores.type, params.scores.shape);
|
const auto scores = std::make_shared<op::v0::Parameter>(params.scores.type, params.scores.shape);
|
||||||
const auto max_output_boxes_per_class =
|
const auto max_output_boxes_per_class =
|
||||||
std::make_shared<opset1::Parameter>(params.maxOutputBoxesPerClass.type,
|
std::make_shared<op::v0::Parameter>(params.maxOutputBoxesPerClass.type,
|
||||||
params.maxOutputBoxesPerClass.shape);
|
params.maxOutputBoxesPerClass.shape);
|
||||||
const auto iou_threshold =
|
const auto iou_threshold =
|
||||||
std::make_shared<opset1::Parameter>(params.iouThreshold.type, params.iouThreshold.shape);
|
std::make_shared<op::v0::Parameter>(params.iouThreshold.type, params.iouThreshold.shape);
|
||||||
const auto score_threshold =
|
const auto score_threshold =
|
||||||
std::make_shared<opset1::Parameter>(params.scoreThreshold.type, params.scoreThreshold.shape);
|
std::make_shared<op::v0::Parameter>(params.scoreThreshold.type, params.scoreThreshold.shape);
|
||||||
const auto nms = std::make_shared<opset13::NMSRotated>(boxes,
|
const auto nms = std::make_shared<op::v13::NMSRotated>(boxes,
|
||||||
scores,
|
scores,
|
||||||
max_output_boxes_per_class,
|
max_output_boxes_per_class,
|
||||||
iou_threshold,
|
iou_threshold,
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/non_max_suppression.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/constant.hpp"
|
||||||
#include "openvino/opsets/opset3.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
#include "openvino/opsets/opset4.hpp"
|
|
||||||
#include "openvino/opsets/opset5.hpp"
|
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -21,7 +21,7 @@ struct NonMaxSuppressionParams {
|
|||||||
reference_tests::Tensor iouThreshold;
|
reference_tests::Tensor iouThreshold;
|
||||||
reference_tests::Tensor scoreThreshold;
|
reference_tests::Tensor scoreThreshold;
|
||||||
reference_tests::Tensor softNmsSigma;
|
reference_tests::Tensor softNmsSigma;
|
||||||
opset5::NonMaxSuppression::BoxEncodingType boxEncoding;
|
op::v5::NonMaxSuppression::BoxEncodingType boxEncoding;
|
||||||
reference_tests::Tensor expectedSelectedIndices;
|
reference_tests::Tensor expectedSelectedIndices;
|
||||||
reference_tests::Tensor expectedSelectedScores;
|
reference_tests::Tensor expectedSelectedScores;
|
||||||
reference_tests::Tensor expectedValidOutputs;
|
reference_tests::Tensor expectedValidOutputs;
|
||||||
@ -75,22 +75,22 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppressionParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppressionParams& params) {
|
||||||
const auto boxes = std::make_shared<opset1::Parameter>(params.boxes.type, params.boxes.shape);
|
const auto boxes = std::make_shared<op::v0::Parameter>(params.boxes.type, params.boxes.shape);
|
||||||
const auto scores = std::make_shared<opset1::Parameter>(params.scores.type, params.scores.shape);
|
const auto scores = std::make_shared<op::v0::Parameter>(params.scores.type, params.scores.shape);
|
||||||
const auto max_output_boxes_per_class =
|
const auto max_output_boxes_per_class =
|
||||||
std::make_shared<opset1::Constant>(params.maxOutputBoxesPerClass.type,
|
std::make_shared<op::v0::Constant>(params.maxOutputBoxesPerClass.type,
|
||||||
params.maxOutputBoxesPerClass.shape,
|
params.maxOutputBoxesPerClass.shape,
|
||||||
params.maxOutputBoxesPerClass.data.data());
|
params.maxOutputBoxesPerClass.data.data());
|
||||||
const auto iou_threshold = std::make_shared<opset1::Constant>(params.iouThreshold.type,
|
const auto iou_threshold = std::make_shared<op::v0::Constant>(params.iouThreshold.type,
|
||||||
params.iouThreshold.shape,
|
params.iouThreshold.shape,
|
||||||
params.iouThreshold.data.data());
|
params.iouThreshold.data.data());
|
||||||
const auto score_threshold = std::make_shared<opset1::Constant>(params.scoreThreshold.type,
|
const auto score_threshold = std::make_shared<op::v0::Constant>(params.scoreThreshold.type,
|
||||||
params.scoreThreshold.shape,
|
params.scoreThreshold.shape,
|
||||||
params.scoreThreshold.data.data());
|
params.scoreThreshold.data.data());
|
||||||
const auto soft_nms_sigma = std::make_shared<opset1::Constant>(params.softNmsSigma.type,
|
const auto soft_nms_sigma = std::make_shared<op::v0::Constant>(params.softNmsSigma.type,
|
||||||
params.softNmsSigma.shape,
|
params.softNmsSigma.shape,
|
||||||
params.softNmsSigma.data.data());
|
params.softNmsSigma.data.data());
|
||||||
const auto nms = std::make_shared<opset5::NonMaxSuppression>(boxes,
|
const auto nms = std::make_shared<op::v5::NonMaxSuppression>(boxes,
|
||||||
scores,
|
scores,
|
||||||
max_output_boxes_per_class,
|
max_output_boxes_per_class,
|
||||||
iou_threshold,
|
iou_threshold,
|
||||||
@ -122,18 +122,18 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppressionParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppressionParams& params) {
|
||||||
const auto boxes = std::make_shared<opset1::Parameter>(params.boxes.type, params.boxes.shape);
|
const auto boxes = std::make_shared<op::v0::Parameter>(params.boxes.type, params.boxes.shape);
|
||||||
const auto scores = std::make_shared<opset1::Parameter>(params.scores.type, params.scores.shape);
|
const auto scores = std::make_shared<op::v0::Parameter>(params.scores.type, params.scores.shape);
|
||||||
const auto max_output_boxes_per_class =
|
const auto max_output_boxes_per_class =
|
||||||
std::make_shared<opset1::Parameter>(params.maxOutputBoxesPerClass.type,
|
std::make_shared<op::v0::Parameter>(params.maxOutputBoxesPerClass.type,
|
||||||
params.maxOutputBoxesPerClass.shape);
|
params.maxOutputBoxesPerClass.shape);
|
||||||
const auto iou_threshold =
|
const auto iou_threshold =
|
||||||
std::make_shared<opset1::Parameter>(params.iouThreshold.type, params.iouThreshold.shape);
|
std::make_shared<op::v0::Parameter>(params.iouThreshold.type, params.iouThreshold.shape);
|
||||||
const auto score_threshold =
|
const auto score_threshold =
|
||||||
std::make_shared<opset1::Parameter>(params.scoreThreshold.type, params.scoreThreshold.shape);
|
std::make_shared<op::v0::Parameter>(params.scoreThreshold.type, params.scoreThreshold.shape);
|
||||||
const auto soft_nms_sigma =
|
const auto soft_nms_sigma =
|
||||||
std::make_shared<opset1::Parameter>(params.softNmsSigma.type, params.softNmsSigma.shape);
|
std::make_shared<op::v0::Parameter>(params.softNmsSigma.type, params.softNmsSigma.shape);
|
||||||
const auto nms = std::make_shared<opset5::NonMaxSuppression>(boxes,
|
const auto nms = std::make_shared<op::v5::NonMaxSuppression>(boxes,
|
||||||
scores,
|
scores,
|
||||||
max_output_boxes_per_class,
|
max_output_boxes_per_class,
|
||||||
iou_threshold,
|
iou_threshold,
|
||||||
@ -173,7 +173,7 @@ std::vector<NonMaxSuppressionParams> generateParams() {
|
|||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CENTER)
|
.boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CENTER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
||||||
.expectedSelectedScores(
|
.expectedSelectedScores(
|
||||||
@ -190,7 +190,7 @@ std::vector<NonMaxSuppressionParams> generateParams() {
|
|||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
||||||
.expectedSelectedScores(
|
.expectedSelectedScores(
|
||||||
@ -211,7 +211,7 @@ std::vector<NonMaxSuppressionParams> generateParams() {
|
|||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
||||||
.expectedSelectedScores(reference_tests::Tensor(ET_TH, {1, 3}, std::vector<T_TH>{0.0, 0.0, 0.9}))
|
.expectedSelectedScores(reference_tests::Tensor(ET_TH, {1, 3}, std::vector<T_TH>{0.0, 0.0, 0.9}))
|
||||||
.expectedValidOutputs(reference_tests::Tensor(ET_IND, {1}, std::vector<T_IND>{1}))
|
.expectedValidOutputs(reference_tests::Tensor(ET_IND, {1}, std::vector<T_IND>{1}))
|
||||||
@ -226,7 +226,7 @@ std::vector<NonMaxSuppressionParams> generateParams() {
|
|||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
||||||
.expectedSelectedScores(
|
.expectedSelectedScores(
|
||||||
reference_tests::Tensor(ET_TH, {2, 3}, std::vector<T_TH>{0.0, 0.0, 0.95, 0.0, 0.0, 0.9}))
|
reference_tests::Tensor(ET_TH, {2, 3}, std::vector<T_TH>{0.0, 0.0, 0.95, 0.0, 0.0, 0.9}))
|
||||||
@ -240,7 +240,7 @@ std::vector<NonMaxSuppressionParams> generateParams() {
|
|||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
||||||
.expectedSelectedScores(reference_tests::Tensor(ET_TH, {1, 3}, std::vector<T_TH>{0.0, 0.0, 0.9}))
|
.expectedSelectedScores(reference_tests::Tensor(ET_TH, {1, 3}, std::vector<T_TH>{0.0, 0.0, 0.9}))
|
||||||
.expectedValidOutputs(reference_tests::Tensor(ET_IND, {1}, std::vector<T_IND>{1}))
|
.expectedValidOutputs(reference_tests::Tensor(ET_IND, {1}, std::vector<T_IND>{1}))
|
||||||
@ -255,7 +255,7 @@ std::vector<NonMaxSuppressionParams> generateParams() {
|
|||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
||||||
.expectedSelectedScores(
|
.expectedSelectedScores(
|
||||||
@ -272,7 +272,7 @@ std::vector<NonMaxSuppressionParams> generateParams() {
|
|||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.4f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.4f}))
|
||||||
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
||||||
.expectedSelectedScores(
|
.expectedSelectedScores(
|
||||||
reference_tests::Tensor(ET_TH, {2, 3}, std::vector<T_TH>{0.0, 0.0, 0.95, 0.0, 0.0, 0.9}))
|
reference_tests::Tensor(ET_TH, {2, 3}, std::vector<T_TH>{0.0, 0.0, 0.95, 0.0, 0.0, 0.9}))
|
||||||
@ -294,7 +294,7 @@ std::vector<NonMaxSuppressionParams> generateParams() {
|
|||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {4, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 1, 0, 3, 1, 0, 0}))
|
reference_tests::Tensor(ET_IND, {4, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 1, 0, 3, 1, 0, 0}))
|
||||||
.expectedSelectedScores(reference_tests::Tensor(
|
.expectedSelectedScores(reference_tests::Tensor(
|
||||||
@ -316,7 +316,7 @@ std::vector<NonMaxSuppressionParams> generateParams() {
|
|||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.softNmsSigma(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {4, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 1, 3, 0, 1, 0}))
|
reference_tests::Tensor(ET_IND, {4, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 1, 3, 0, 1, 0}))
|
||||||
.expectedSelectedScores(reference_tests::Tensor(
|
.expectedSelectedScores(reference_tests::Tensor(
|
||||||
@ -363,7 +363,7 @@ std::vector<NonMaxSuppressionParams> generateParamsWithoutConstants() {
|
|||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {1}, std::vector<T_TH>{0.4f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {1}, std::vector<T_TH>{0.4f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {1}, std::vector<T_TH>{0.2f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {1}, std::vector<T_TH>{0.2f}))
|
||||||
.softNmsSigma(reference_tests::Tensor(ET_TH, {1}, std::vector<T_TH>{0.0f}))
|
.softNmsSigma(reference_tests::Tensor(ET_TH, {1}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset5::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v5::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 3}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 3}))
|
||||||
.expectedSelectedScores(reference_tests::Tensor(ET_TH, {1, 3}, std::vector<T_TH>{0.0f, 0.0f, 0.95f}))
|
.expectedSelectedScores(reference_tests::Tensor(ET_TH, {1, 3}, std::vector<T_TH>{0.0f, 0.0f, 0.95f}))
|
||||||
.expectedValidOutputs(reference_tests::Tensor(ET_IND, {1}, std::vector<T_IND>{1}))
|
.expectedValidOutputs(reference_tests::Tensor(ET_IND, {1}, std::vector<T_IND>{1}))
|
||||||
@ -422,7 +422,7 @@ struct NonMaxSuppression4Params {
|
|||||||
reference_tests::Tensor maxOutputBoxesPerClass;
|
reference_tests::Tensor maxOutputBoxesPerClass;
|
||||||
reference_tests::Tensor iouThreshold;
|
reference_tests::Tensor iouThreshold;
|
||||||
reference_tests::Tensor scoreThreshold;
|
reference_tests::Tensor scoreThreshold;
|
||||||
opset4::NonMaxSuppression::BoxEncodingType boxEncoding;
|
op::v4::NonMaxSuppression::BoxEncodingType boxEncoding;
|
||||||
reference_tests::Tensor expectedSelectedIndices;
|
reference_tests::Tensor expectedSelectedIndices;
|
||||||
std::string testcaseName;
|
std::string testcaseName;
|
||||||
};
|
};
|
||||||
@ -465,19 +465,19 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppression4Params& params) {
|
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppression4Params& params) {
|
||||||
const auto boxes = std::make_shared<opset1::Parameter>(params.boxes.type, params.boxes.shape);
|
const auto boxes = std::make_shared<op::v0::Parameter>(params.boxes.type, params.boxes.shape);
|
||||||
const auto scores = std::make_shared<opset1::Parameter>(params.scores.type, params.scores.shape);
|
const auto scores = std::make_shared<op::v0::Parameter>(params.scores.type, params.scores.shape);
|
||||||
const auto max_output_boxes_per_class =
|
const auto max_output_boxes_per_class =
|
||||||
std::make_shared<opset1::Constant>(params.maxOutputBoxesPerClass.type,
|
std::make_shared<op::v0::Constant>(params.maxOutputBoxesPerClass.type,
|
||||||
params.maxOutputBoxesPerClass.shape,
|
params.maxOutputBoxesPerClass.shape,
|
||||||
params.maxOutputBoxesPerClass.data.data());
|
params.maxOutputBoxesPerClass.data.data());
|
||||||
const auto iou_threshold = std::make_shared<opset1::Constant>(params.iouThreshold.type,
|
const auto iou_threshold = std::make_shared<op::v0::Constant>(params.iouThreshold.type,
|
||||||
params.iouThreshold.shape,
|
params.iouThreshold.shape,
|
||||||
params.iouThreshold.data.data());
|
params.iouThreshold.data.data());
|
||||||
const auto score_threshold = std::make_shared<opset1::Constant>(params.scoreThreshold.type,
|
const auto score_threshold = std::make_shared<op::v0::Constant>(params.scoreThreshold.type,
|
||||||
params.scoreThreshold.shape,
|
params.scoreThreshold.shape,
|
||||||
params.scoreThreshold.data.data());
|
params.scoreThreshold.data.data());
|
||||||
const auto nms = std::make_shared<opset4::NonMaxSuppression>(boxes,
|
const auto nms = std::make_shared<op::v4::NonMaxSuppression>(boxes,
|
||||||
scores,
|
scores,
|
||||||
max_output_boxes_per_class,
|
max_output_boxes_per_class,
|
||||||
iou_threshold,
|
iou_threshold,
|
||||||
@ -505,16 +505,16 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppression4Params& params) {
|
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppression4Params& params) {
|
||||||
const auto boxes = std::make_shared<opset1::Parameter>(params.boxes.type, params.boxes.shape);
|
const auto boxes = std::make_shared<op::v0::Parameter>(params.boxes.type, params.boxes.shape);
|
||||||
const auto scores = std::make_shared<opset1::Parameter>(params.scores.type, params.scores.shape);
|
const auto scores = std::make_shared<op::v0::Parameter>(params.scores.type, params.scores.shape);
|
||||||
const auto max_output_boxes_per_class =
|
const auto max_output_boxes_per_class =
|
||||||
std::make_shared<opset1::Parameter>(params.maxOutputBoxesPerClass.type,
|
std::make_shared<op::v0::Parameter>(params.maxOutputBoxesPerClass.type,
|
||||||
params.maxOutputBoxesPerClass.shape);
|
params.maxOutputBoxesPerClass.shape);
|
||||||
const auto iou_threshold =
|
const auto iou_threshold =
|
||||||
std::make_shared<opset1::Parameter>(params.iouThreshold.type, params.iouThreshold.shape);
|
std::make_shared<op::v0::Parameter>(params.iouThreshold.type, params.iouThreshold.shape);
|
||||||
const auto score_threshold =
|
const auto score_threshold =
|
||||||
std::make_shared<opset1::Parameter>(params.scoreThreshold.type, params.scoreThreshold.shape);
|
std::make_shared<op::v0::Parameter>(params.scoreThreshold.type, params.scoreThreshold.shape);
|
||||||
const auto nms = std::make_shared<opset4::NonMaxSuppression>(boxes,
|
const auto nms = std::make_shared<op::v4::NonMaxSuppression>(boxes,
|
||||||
scores,
|
scores,
|
||||||
max_output_boxes_per_class,
|
max_output_boxes_per_class,
|
||||||
iou_threshold,
|
iou_threshold,
|
||||||
@ -552,7 +552,7 @@ std::vector<NonMaxSuppression4Params> generateParams4() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CENTER)
|
.boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CENTER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
||||||
.testcaseName("nonmaxsuppression_center_point_box_format"),
|
.testcaseName("nonmaxsuppression_center_point_box_format"),
|
||||||
@ -565,7 +565,7 @@ std::vector<NonMaxSuppression4Params> generateParams4() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
||||||
.testcaseName("nonmaxsuppression_flipped_coordinates"),
|
.testcaseName("nonmaxsuppression_flipped_coordinates"),
|
||||||
@ -582,7 +582,7 @@ std::vector<NonMaxSuppression4Params> generateParams4() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{1}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{1}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
||||||
.testcaseName("nonmaxsuppression_identical_boxes"),
|
.testcaseName("nonmaxsuppression_identical_boxes"),
|
||||||
|
|
||||||
@ -594,7 +594,7 @@ std::vector<NonMaxSuppression4Params> generateParams4() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
||||||
.testcaseName("nonmaxsuppression_limit_output_size"),
|
.testcaseName("nonmaxsuppression_limit_output_size"),
|
||||||
|
|
||||||
@ -604,7 +604,7 @@ std::vector<NonMaxSuppression4Params> generateParams4() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
||||||
.testcaseName("nonmaxsuppression_single_box"),
|
.testcaseName("nonmaxsuppression_single_box"),
|
||||||
|
|
||||||
@ -616,7 +616,7 @@ std::vector<NonMaxSuppression4Params> generateParams4() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
||||||
.testcaseName("nonmaxsuppression_suppress_by_IOU"),
|
.testcaseName("nonmaxsuppression_suppress_by_IOU"),
|
||||||
@ -629,7 +629,7 @@ std::vector<NonMaxSuppression4Params> generateParams4() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.4f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.4f}))
|
||||||
.boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
||||||
.testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores"),
|
.testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores"),
|
||||||
|
|
||||||
@ -647,7 +647,7 @@ std::vector<NonMaxSuppression4Params> generateParams4() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {4, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 1, 0, 3, 1, 0, 0}))
|
reference_tests::Tensor(ET_IND, {4, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 1, 0, 3, 1, 0, 0}))
|
||||||
.testcaseName("nonmaxsuppression_two_batches"),
|
.testcaseName("nonmaxsuppression_two_batches"),
|
||||||
@ -663,7 +663,7 @@ std::vector<NonMaxSuppression4Params> generateParams4() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {4, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 1, 3, 0, 1, 0}))
|
reference_tests::Tensor(ET_IND, {4, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 1, 3, 0, 1, 0}))
|
||||||
.testcaseName("nonmaxsuppression_two_classes"),
|
.testcaseName("nonmaxsuppression_two_classes"),
|
||||||
@ -704,7 +704,7 @@ std::vector<NonMaxSuppression4Params> generateParams4WithoutConstants() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{1}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{1}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.4f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.4f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.2f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.2f}))
|
||||||
.boxEncoding(opset4::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v4::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 3}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 3}))
|
||||||
.testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores_without_constants"),
|
.testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores_without_constants"),
|
||||||
};
|
};
|
||||||
@ -761,7 +761,7 @@ struct NonMaxSuppression3Params {
|
|||||||
reference_tests::Tensor maxOutputBoxesPerClass;
|
reference_tests::Tensor maxOutputBoxesPerClass;
|
||||||
reference_tests::Tensor iouThreshold;
|
reference_tests::Tensor iouThreshold;
|
||||||
reference_tests::Tensor scoreThreshold;
|
reference_tests::Tensor scoreThreshold;
|
||||||
opset3::NonMaxSuppression::BoxEncodingType boxEncoding;
|
op::v3::NonMaxSuppression::BoxEncodingType boxEncoding;
|
||||||
reference_tests::Tensor expectedSelectedIndices;
|
reference_tests::Tensor expectedSelectedIndices;
|
||||||
std::string testcaseName;
|
std::string testcaseName;
|
||||||
};
|
};
|
||||||
@ -804,19 +804,19 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppression3Params& params) {
|
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppression3Params& params) {
|
||||||
const auto boxes = std::make_shared<opset1::Parameter>(params.boxes.type, params.boxes.shape);
|
const auto boxes = std::make_shared<op::v0::Parameter>(params.boxes.type, params.boxes.shape);
|
||||||
const auto scores = std::make_shared<opset1::Parameter>(params.scores.type, params.scores.shape);
|
const auto scores = std::make_shared<op::v0::Parameter>(params.scores.type, params.scores.shape);
|
||||||
const auto max_output_boxes_per_class =
|
const auto max_output_boxes_per_class =
|
||||||
std::make_shared<opset1::Constant>(params.maxOutputBoxesPerClass.type,
|
std::make_shared<op::v0::Constant>(params.maxOutputBoxesPerClass.type,
|
||||||
params.maxOutputBoxesPerClass.shape,
|
params.maxOutputBoxesPerClass.shape,
|
||||||
params.maxOutputBoxesPerClass.data.data());
|
params.maxOutputBoxesPerClass.data.data());
|
||||||
const auto iou_threshold = std::make_shared<opset1::Constant>(params.iouThreshold.type,
|
const auto iou_threshold = std::make_shared<op::v0::Constant>(params.iouThreshold.type,
|
||||||
params.iouThreshold.shape,
|
params.iouThreshold.shape,
|
||||||
params.iouThreshold.data.data());
|
params.iouThreshold.data.data());
|
||||||
const auto score_threshold = std::make_shared<opset1::Constant>(params.scoreThreshold.type,
|
const auto score_threshold = std::make_shared<op::v0::Constant>(params.scoreThreshold.type,
|
||||||
params.scoreThreshold.shape,
|
params.scoreThreshold.shape,
|
||||||
params.scoreThreshold.data.data());
|
params.scoreThreshold.data.data());
|
||||||
const auto nms = std::make_shared<opset3::NonMaxSuppression>(boxes,
|
const auto nms = std::make_shared<op::v3::NonMaxSuppression>(boxes,
|
||||||
scores,
|
scores,
|
||||||
max_output_boxes_per_class,
|
max_output_boxes_per_class,
|
||||||
iou_threshold,
|
iou_threshold,
|
||||||
@ -844,16 +844,16 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppression3Params& params) {
|
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppression3Params& params) {
|
||||||
const auto boxes = std::make_shared<opset1::Parameter>(params.boxes.type, params.boxes.shape);
|
const auto boxes = std::make_shared<op::v0::Parameter>(params.boxes.type, params.boxes.shape);
|
||||||
const auto scores = std::make_shared<opset1::Parameter>(params.scores.type, params.scores.shape);
|
const auto scores = std::make_shared<op::v0::Parameter>(params.scores.type, params.scores.shape);
|
||||||
const auto max_output_boxes_per_class =
|
const auto max_output_boxes_per_class =
|
||||||
std::make_shared<opset1::Parameter>(params.maxOutputBoxesPerClass.type,
|
std::make_shared<op::v0::Parameter>(params.maxOutputBoxesPerClass.type,
|
||||||
params.maxOutputBoxesPerClass.shape);
|
params.maxOutputBoxesPerClass.shape);
|
||||||
const auto iou_threshold =
|
const auto iou_threshold =
|
||||||
std::make_shared<opset1::Parameter>(params.iouThreshold.type, params.iouThreshold.shape);
|
std::make_shared<op::v0::Parameter>(params.iouThreshold.type, params.iouThreshold.shape);
|
||||||
const auto score_threshold =
|
const auto score_threshold =
|
||||||
std::make_shared<opset1::Parameter>(params.scoreThreshold.type, params.scoreThreshold.shape);
|
std::make_shared<op::v0::Parameter>(params.scoreThreshold.type, params.scoreThreshold.shape);
|
||||||
const auto nms = std::make_shared<opset3::NonMaxSuppression>(boxes,
|
const auto nms = std::make_shared<op::v3::NonMaxSuppression>(boxes,
|
||||||
scores,
|
scores,
|
||||||
max_output_boxes_per_class,
|
max_output_boxes_per_class,
|
||||||
iou_threshold,
|
iou_threshold,
|
||||||
@ -891,7 +891,7 @@ std::vector<NonMaxSuppression3Params> generateParams3() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CENTER)
|
.boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CENTER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
||||||
.testcaseName("nonmaxsuppression_center_point_box_format"),
|
.testcaseName("nonmaxsuppression_center_point_box_format"),
|
||||||
@ -904,7 +904,7 @@ std::vector<NonMaxSuppression3Params> generateParams3() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
||||||
.testcaseName("nonmaxsuppression_flipped_coordinates"),
|
.testcaseName("nonmaxsuppression_flipped_coordinates"),
|
||||||
@ -921,7 +921,7 @@ std::vector<NonMaxSuppression3Params> generateParams3() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{1}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{1}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
||||||
.testcaseName("nonmaxsuppression_identical_boxes"),
|
.testcaseName("nonmaxsuppression_identical_boxes"),
|
||||||
|
|
||||||
@ -933,7 +933,7 @@ std::vector<NonMaxSuppression3Params> generateParams3() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
||||||
.testcaseName("nonmaxsuppression_limit_output_size"),
|
.testcaseName("nonmaxsuppression_limit_output_size"),
|
||||||
|
|
||||||
@ -943,7 +943,7 @@ std::vector<NonMaxSuppression3Params> generateParams3() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
||||||
.testcaseName("nonmaxsuppression_single_box"),
|
.testcaseName("nonmaxsuppression_single_box"),
|
||||||
|
|
||||||
@ -955,7 +955,7 @@ std::vector<NonMaxSuppression3Params> generateParams3() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
||||||
.testcaseName("nonmaxsuppression_suppress_by_IOU"),
|
.testcaseName("nonmaxsuppression_suppress_by_IOU"),
|
||||||
@ -968,7 +968,7 @@ std::vector<NonMaxSuppression3Params> generateParams3() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.4f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.4f}))
|
||||||
.boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
||||||
.testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores"),
|
.testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores"),
|
||||||
|
|
||||||
@ -983,7 +983,7 @@ std::vector<NonMaxSuppression3Params> generateParams3() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {4, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 1, 3, 0, 1, 0}))
|
reference_tests::Tensor(ET_IND, {4, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 1, 3, 0, 1, 0}))
|
||||||
.testcaseName("nonmaxsuppression_two_classes"),
|
.testcaseName("nonmaxsuppression_two_classes"),
|
||||||
@ -1024,7 +1024,7 @@ std::vector<NonMaxSuppression3Params> generateParams3WithoutConstants() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{1}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{1}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.4f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.4f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.2f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.2f}))
|
||||||
.boxEncoding(opset3::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v3::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 3}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 3}))
|
||||||
.testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores_without_constants"),
|
.testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores_without_constants"),
|
||||||
};
|
};
|
||||||
@ -1081,7 +1081,7 @@ struct NonMaxSuppression1Params {
|
|||||||
reference_tests::Tensor maxOutputBoxesPerClass;
|
reference_tests::Tensor maxOutputBoxesPerClass;
|
||||||
reference_tests::Tensor iouThreshold;
|
reference_tests::Tensor iouThreshold;
|
||||||
reference_tests::Tensor scoreThreshold;
|
reference_tests::Tensor scoreThreshold;
|
||||||
opset1::NonMaxSuppression::BoxEncodingType boxEncoding;
|
op::v1::NonMaxSuppression::BoxEncodingType boxEncoding;
|
||||||
reference_tests::Tensor expectedSelectedIndices;
|
reference_tests::Tensor expectedSelectedIndices;
|
||||||
std::string testcaseName;
|
std::string testcaseName;
|
||||||
};
|
};
|
||||||
@ -1124,19 +1124,19 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppression1Params& params) {
|
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppression1Params& params) {
|
||||||
const auto boxes = std::make_shared<opset1::Parameter>(params.boxes.type, params.boxes.shape);
|
const auto boxes = std::make_shared<op::v0::Parameter>(params.boxes.type, params.boxes.shape);
|
||||||
const auto scores = std::make_shared<opset1::Parameter>(params.scores.type, params.scores.shape);
|
const auto scores = std::make_shared<op::v0::Parameter>(params.scores.type, params.scores.shape);
|
||||||
const auto max_output_boxes_per_class =
|
const auto max_output_boxes_per_class =
|
||||||
std::make_shared<opset1::Constant>(params.maxOutputBoxesPerClass.type,
|
std::make_shared<op::v0::Constant>(params.maxOutputBoxesPerClass.type,
|
||||||
params.maxOutputBoxesPerClass.shape,
|
params.maxOutputBoxesPerClass.shape,
|
||||||
params.maxOutputBoxesPerClass.data.data());
|
params.maxOutputBoxesPerClass.data.data());
|
||||||
const auto iou_threshold = std::make_shared<opset1::Constant>(params.iouThreshold.type,
|
const auto iou_threshold = std::make_shared<op::v0::Constant>(params.iouThreshold.type,
|
||||||
params.iouThreshold.shape,
|
params.iouThreshold.shape,
|
||||||
params.iouThreshold.data.data());
|
params.iouThreshold.data.data());
|
||||||
const auto score_threshold = std::make_shared<opset1::Constant>(params.scoreThreshold.type,
|
const auto score_threshold = std::make_shared<op::v0::Constant>(params.scoreThreshold.type,
|
||||||
params.scoreThreshold.shape,
|
params.scoreThreshold.shape,
|
||||||
params.scoreThreshold.data.data());
|
params.scoreThreshold.data.data());
|
||||||
const auto nms = std::make_shared<opset1::NonMaxSuppression>(boxes,
|
const auto nms = std::make_shared<op::v1::NonMaxSuppression>(boxes,
|
||||||
scores,
|
scores,
|
||||||
max_output_boxes_per_class,
|
max_output_boxes_per_class,
|
||||||
iou_threshold,
|
iou_threshold,
|
||||||
@ -1163,16 +1163,16 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppression1Params& params) {
|
static std::shared_ptr<Model> CreateFunction(const NonMaxSuppression1Params& params) {
|
||||||
const auto boxes = std::make_shared<opset1::Parameter>(params.boxes.type, params.boxes.shape);
|
const auto boxes = std::make_shared<op::v0::Parameter>(params.boxes.type, params.boxes.shape);
|
||||||
const auto scores = std::make_shared<opset1::Parameter>(params.scores.type, params.scores.shape);
|
const auto scores = std::make_shared<op::v0::Parameter>(params.scores.type, params.scores.shape);
|
||||||
const auto max_output_boxes_per_class =
|
const auto max_output_boxes_per_class =
|
||||||
std::make_shared<opset1::Parameter>(params.maxOutputBoxesPerClass.type,
|
std::make_shared<op::v0::Parameter>(params.maxOutputBoxesPerClass.type,
|
||||||
params.maxOutputBoxesPerClass.shape);
|
params.maxOutputBoxesPerClass.shape);
|
||||||
const auto iou_threshold =
|
const auto iou_threshold =
|
||||||
std::make_shared<opset1::Parameter>(params.iouThreshold.type, params.iouThreshold.shape);
|
std::make_shared<op::v0::Parameter>(params.iouThreshold.type, params.iouThreshold.shape);
|
||||||
const auto score_threshold =
|
const auto score_threshold =
|
||||||
std::make_shared<opset1::Parameter>(params.scoreThreshold.type, params.scoreThreshold.shape);
|
std::make_shared<op::v0::Parameter>(params.scoreThreshold.type, params.scoreThreshold.shape);
|
||||||
const auto nms = std::make_shared<opset1::NonMaxSuppression>(boxes,
|
const auto nms = std::make_shared<op::v1::NonMaxSuppression>(boxes,
|
||||||
scores,
|
scores,
|
||||||
max_output_boxes_per_class,
|
max_output_boxes_per_class,
|
||||||
iou_threshold,
|
iou_threshold,
|
||||||
@ -1209,7 +1209,7 @@ std::vector<NonMaxSuppression1Params> generateParams1() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CENTER)
|
.boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CENTER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
||||||
.testcaseName("nonmaxsuppression_center_point_box_format"),
|
.testcaseName("nonmaxsuppression_center_point_box_format"),
|
||||||
@ -1222,7 +1222,7 @@ std::vector<NonMaxSuppression1Params> generateParams1() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
||||||
.testcaseName("nonmaxsuppression_flipped_coordinates"),
|
.testcaseName("nonmaxsuppression_flipped_coordinates"),
|
||||||
@ -1239,7 +1239,7 @@ std::vector<NonMaxSuppression1Params> generateParams1() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{1}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{1}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
||||||
.testcaseName("nonmaxsuppression_identical_boxes"),
|
.testcaseName("nonmaxsuppression_identical_boxes"),
|
||||||
|
|
||||||
@ -1251,7 +1251,7 @@ std::vector<NonMaxSuppression1Params> generateParams1() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
||||||
.testcaseName("nonmaxsuppression_limit_output_size"),
|
.testcaseName("nonmaxsuppression_limit_output_size"),
|
||||||
|
|
||||||
@ -1261,7 +1261,7 @@ std::vector<NonMaxSuppression1Params> generateParams1() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 0}))
|
||||||
.testcaseName("nonmaxsuppression_single_box"),
|
.testcaseName("nonmaxsuppression_single_box"),
|
||||||
|
|
||||||
@ -1273,7 +1273,7 @@ std::vector<NonMaxSuppression1Params> generateParams1() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{3}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
reference_tests::Tensor(ET_IND, {3, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 0, 5}))
|
||||||
.testcaseName("nonmaxsuppression_suppress_by_IOU"),
|
.testcaseName("nonmaxsuppression_suppress_by_IOU"),
|
||||||
@ -1286,7 +1286,7 @@ std::vector<NonMaxSuppression1Params> generateParams1() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.4f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.4f}))
|
||||||
.boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {2, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0}))
|
||||||
.testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores"),
|
.testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores"),
|
||||||
|
|
||||||
@ -1301,7 +1301,7 @@ std::vector<NonMaxSuppression1Params> generateParams1() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{2}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.5f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.0f}))
|
||||||
.boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(
|
.expectedSelectedIndices(
|
||||||
reference_tests::Tensor(ET_IND, {4, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 1, 3, 0, 1, 0}))
|
reference_tests::Tensor(ET_IND, {4, 3}, std::vector<T_IND>{0, 0, 3, 0, 0, 0, 0, 1, 3, 0, 1, 0}))
|
||||||
.testcaseName("nonmaxsuppression_two_classes"),
|
.testcaseName("nonmaxsuppression_two_classes"),
|
||||||
@ -1339,7 +1339,7 @@ std::vector<NonMaxSuppression1Params> generateParams1WithoutConstants() {
|
|||||||
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{1}))
|
.maxOutputBoxesPerClass(reference_tests::Tensor(ET_BOX, {}, std::vector<T_BOX>{1}))
|
||||||
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.4f}))
|
.iouThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.4f}))
|
||||||
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.2f}))
|
.scoreThreshold(reference_tests::Tensor(ET_TH, {}, std::vector<T_TH>{0.2f}))
|
||||||
.boxEncoding(opset1::NonMaxSuppression::BoxEncodingType::CORNER)
|
.boxEncoding(op::v1::NonMaxSuppression::BoxEncodingType::CORNER)
|
||||||
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 3}))
|
.expectedSelectedIndices(reference_tests::Tensor(ET_IND, {1, 3}, std::vector<T_IND>{0, 0, 3}))
|
||||||
.testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores_without_constants"),
|
.testcaseName("nonmaxsuppression_suppress_by_IOU_and_scores_without_constants"),
|
||||||
};
|
};
|
||||||
|
@ -6,9 +6,8 @@
|
|||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <functional_test_utils/skip_tests_config.hpp>
|
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
|
#include "functional_test_utils/skip_tests_config.hpp"
|
||||||
#include "openvino/op/constant.hpp"
|
#include "openvino/op/constant.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
|
@ -2,11 +2,13 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/prior_box_clustered.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
|
#include "openvino/op/constant.hpp"
|
||||||
#include "openvino/op/prior_box.hpp"
|
#include "openvino/op/prior_box.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -76,9 +78,9 @@ public:
|
|||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const PriorBoxClusteredParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const PriorBoxClusteredParams& params) {
|
||||||
auto LS =
|
auto LS =
|
||||||
std::make_shared<opset1::Constant>(params.inType, params.layerShapeShape, params.layerShapeData.data());
|
std::make_shared<op::v0::Constant>(params.inType, params.layerShapeShape, params.layerShapeData.data());
|
||||||
auto IS =
|
auto IS =
|
||||||
std::make_shared<opset1::Constant>(params.inType, params.imageShapeShape, params.imageShapeData.data());
|
std::make_shared<op::v0::Constant>(params.inType, params.imageShapeShape, params.imageShapeData.data());
|
||||||
const auto PriorBoxClustered = std::make_shared<op::v0::PriorBoxClustered>(LS, IS, params.attrs);
|
const auto PriorBoxClustered = std::make_shared<op::v0::PriorBoxClustered>(LS, IS, params.attrs);
|
||||||
return std::make_shared<ov::Model>(NodeVector{PriorBoxClustered}, ParameterVector{});
|
return std::make_shared<ov::Model>(NodeVector{PriorBoxClustered}, ParameterVector{});
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,13 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/random_uniform.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset8.hpp"
|
#include "openvino/op/constant.hpp"
|
||||||
|
#include "openvino/op/parameter.hpp"
|
||||||
|
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
|
|
||||||
@ -64,11 +67,11 @@ private:
|
|||||||
const ov::element::Type& out_type,
|
const ov::element::Type& out_type,
|
||||||
int64_t global_seed,
|
int64_t global_seed,
|
||||||
int64_t op_seed) {
|
int64_t op_seed) {
|
||||||
const auto min_val_param = std::make_shared<opset8::Parameter>(min_val.type, min_val.shape);
|
const auto min_val_param = std::make_shared<op::v0::Parameter>(min_val.type, min_val.shape);
|
||||||
const auto max_val_param = std::make_shared<opset8::Parameter>(max_val.type, max_val.shape);
|
const auto max_val_param = std::make_shared<op::v0::Parameter>(max_val.type, max_val.shape);
|
||||||
auto out_shape_ = std::make_shared<opset8::Constant>(element::i64, Shape{out_shape.size()}, out_shape);
|
auto out_shape_ = std::make_shared<op::v0::Constant>(element::i64, Shape{out_shape.size()}, out_shape);
|
||||||
|
|
||||||
return std::make_shared<ov::Model>(NodeVector{std::make_shared<opset8::RandomUniform>(out_shape_,
|
return std::make_shared<ov::Model>(NodeVector{std::make_shared<op::v8::RandomUniform>(out_shape_,
|
||||||
min_val_param,
|
min_val_param,
|
||||||
max_val_param,
|
max_val_param,
|
||||||
out_type,
|
out_type,
|
||||||
|
@ -2,14 +2,13 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/roi_align.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/constant.hpp"
|
||||||
#include "openvino/opsets/opset3.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
#include "openvino/opsets/opset4.hpp"
|
|
||||||
#include "openvino/opsets/opset5.hpp"
|
|
||||||
#include "openvino/opsets/opset9.hpp"
|
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -133,12 +132,12 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ROIAlignParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const ROIAlignParams& params) {
|
||||||
const auto featureMap = std::make_shared<opset1::Parameter>(params.iType, params.pShape);
|
const auto featureMap = std::make_shared<op::v0::Parameter>(params.iType, params.pShape);
|
||||||
const auto coords =
|
const auto coords =
|
||||||
std::make_shared<opset1::Constant>(params.coords.type, params.coords.shape, params.coords.data.data());
|
std::make_shared<op::v0::Constant>(params.coords.type, params.coords.shape, params.coords.data.data());
|
||||||
const auto roisIdx =
|
const auto roisIdx =
|
||||||
std::make_shared<opset1::Constant>(params.roiIdx.type, params.roiIdx.shape, params.roiIdx.data.data());
|
std::make_shared<op::v0::Constant>(params.roiIdx.type, params.roiIdx.shape, params.roiIdx.data.data());
|
||||||
const auto roi_align = std::make_shared<opset3::ROIAlign>(featureMap,
|
const auto roi_align = std::make_shared<op::v3::ROIAlign>(featureMap,
|
||||||
coords,
|
coords,
|
||||||
roisIdx,
|
roisIdx,
|
||||||
params.pooledH,
|
params.pooledH,
|
||||||
@ -185,14 +184,14 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ROIAlignV9Params& params) {
|
static std::shared_ptr<Model> CreateFunction(const ROIAlignV9Params& params) {
|
||||||
const auto featureMap = std::make_shared<opset1::Parameter>(params.iType, params.pShape);
|
const auto featureMap = std::make_shared<op::v0::Parameter>(params.iType, params.pShape);
|
||||||
const auto coords =
|
const auto coords =
|
||||||
std::make_shared<opset1::Constant>(params.coords.type, params.coords.shape, params.coords.data.data());
|
std::make_shared<op::v0::Constant>(params.coords.type, params.coords.shape, params.coords.data.data());
|
||||||
const auto roisIdx =
|
const auto roisIdx =
|
||||||
std::make_shared<opset1::Constant>(params.roiIdx.type, params.roiIdx.shape, params.roiIdx.data.data());
|
std::make_shared<op::v0::Constant>(params.roiIdx.type, params.roiIdx.shape, params.roiIdx.data.data());
|
||||||
const auto pooling_mode = EnumNames<opset9::ROIAlign::PoolingMode>::as_enum(params.poolingMode);
|
const auto pooling_mode = EnumNames<op::v9::ROIAlign::PoolingMode>::as_enum(params.poolingMode);
|
||||||
const auto aligned_mode = EnumNames<opset9::ROIAlign::AlignedMode>::as_enum(params.alignedMode);
|
const auto aligned_mode = EnumNames<op::v9::ROIAlign::AlignedMode>::as_enum(params.alignedMode);
|
||||||
const auto roi_align = std::make_shared<opset9::ROIAlign>(featureMap,
|
const auto roi_align = std::make_shared<op::v9::ROIAlign>(featureMap,
|
||||||
coords,
|
coords,
|
||||||
roisIdx,
|
roisIdx,
|
||||||
params.pooledH,
|
params.pooledH,
|
||||||
|
@ -2,11 +2,13 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/roll.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/constant.hpp"
|
||||||
#include "openvino/opsets/opset7.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -61,14 +63,14 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const RollParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const RollParams& params) {
|
||||||
const auto data = std::make_shared<opset1::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
const auto data = std::make_shared<op::v0::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
||||||
const auto shift = std::make_shared<opset1::Constant>(params.shiftTensor.type,
|
const auto shift = std::make_shared<op::v0::Constant>(params.shiftTensor.type,
|
||||||
params.shiftTensor.shape,
|
params.shiftTensor.shape,
|
||||||
params.shiftTensor.data.data());
|
params.shiftTensor.data.data());
|
||||||
const auto axes = std::make_shared<opset1::Constant>(params.axesTensor.type,
|
const auto axes = std::make_shared<op::v0::Constant>(params.axesTensor.type,
|
||||||
params.axesTensor.shape,
|
params.axesTensor.shape,
|
||||||
params.axesTensor.data.data());
|
params.axesTensor.data.data());
|
||||||
const auto roll = std::make_shared<opset7::Roll>(data, shift, axes);
|
const auto roll = std::make_shared<op::v7::Roll>(data, shift, axes);
|
||||||
return std::make_shared<Model>(NodeVector{roll}, ParameterVector{data});
|
return std::make_shared<Model>(NodeVector{roll}, ParameterVector{data});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -2,10 +2,12 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/shuffle_channels.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -59,8 +61,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const ShuffleChannelsParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const ShuffleChannelsParams& params) {
|
||||||
const auto data = std::make_shared<opset1::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
const auto data = std::make_shared<op::v0::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
||||||
const auto function = std::make_shared<opset1::ShuffleChannels>(data, params.axis, params.group);
|
const auto function = std::make_shared<op::v0::ShuffleChannels>(data, params.axis, params.group);
|
||||||
return std::make_shared<Model>(NodeVector{function}, ParameterVector{data});
|
return std::make_shared<Model>(NodeVector{function}, ParameterVector{data});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -2,12 +2,14 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/slice.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset8.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
|
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
|
|
||||||
@ -102,13 +104,13 @@ private:
|
|||||||
const reference_tests::Tensor& stop,
|
const reference_tests::Tensor& stop,
|
||||||
const reference_tests::Tensor& step,
|
const reference_tests::Tensor& step,
|
||||||
const reference_tests::Tensor& axes) {
|
const reference_tests::Tensor& axes) {
|
||||||
const auto data_param = std::make_shared<opset8::Parameter>(data.type, data.shape);
|
const auto data_param = std::make_shared<op::v0::Parameter>(data.type, data.shape);
|
||||||
const auto start_param = std::make_shared<opset8::Parameter>(start.type, start.shape);
|
const auto start_param = std::make_shared<op::v0::Parameter>(start.type, start.shape);
|
||||||
const auto stop_param = std::make_shared<opset8::Parameter>(stop.type, stop.shape);
|
const auto stop_param = std::make_shared<op::v0::Parameter>(stop.type, stop.shape);
|
||||||
const auto step_param = std::make_shared<opset8::Parameter>(step.type, step.shape);
|
const auto step_param = std::make_shared<op::v0::Parameter>(step.type, step.shape);
|
||||||
const auto axes_param = std::make_shared<opset8::Parameter>(axes.type, axes.shape);
|
const auto axes_param = std::make_shared<op::v0::Parameter>(axes.type, axes.shape);
|
||||||
|
|
||||||
const auto slice = std::make_shared<opset8::Slice>(data_param, start_param, stop_param, step_param, axes_param);
|
const auto slice = std::make_shared<op::v8::Slice>(data_param, start_param, stop_param, step_param, axes_param);
|
||||||
return std::make_shared<Model>(NodeVector{slice},
|
return std::make_shared<Model>(NodeVector{slice},
|
||||||
ParameterVector{data_param, start_param, stop_param, step_param, axes_param});
|
ParameterVector{data_param, start_param, stop_param, step_param, axes_param});
|
||||||
}
|
}
|
||||||
@ -118,12 +120,12 @@ private:
|
|||||||
const reference_tests::Tensor& start,
|
const reference_tests::Tensor& start,
|
||||||
const reference_tests::Tensor& stop,
|
const reference_tests::Tensor& stop,
|
||||||
const reference_tests::Tensor& step) {
|
const reference_tests::Tensor& step) {
|
||||||
const auto data_param = std::make_shared<opset8::Parameter>(data.type, data.shape);
|
const auto data_param = std::make_shared<op::v0::Parameter>(data.type, data.shape);
|
||||||
const auto start_param = std::make_shared<opset8::Parameter>(start.type, start.shape);
|
const auto start_param = std::make_shared<op::v0::Parameter>(start.type, start.shape);
|
||||||
const auto stop_param = std::make_shared<opset8::Parameter>(stop.type, stop.shape);
|
const auto stop_param = std::make_shared<op::v0::Parameter>(stop.type, stop.shape);
|
||||||
const auto step_param = std::make_shared<opset8::Parameter>(step.type, step.shape);
|
const auto step_param = std::make_shared<op::v0::Parameter>(step.type, step.shape);
|
||||||
|
|
||||||
const auto slice = std::make_shared<opset8::Slice>(data_param, start_param, stop_param, step_param);
|
const auto slice = std::make_shared<op::v8::Slice>(data_param, start_param, stop_param, step_param);
|
||||||
return std::make_shared<Model>(NodeVector{slice},
|
return std::make_shared<Model>(NodeVector{slice},
|
||||||
ParameterVector{data_param, start_param, stop_param, step_param});
|
ParameterVector{data_param, start_param, stop_param, step_param});
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/space_to_batch.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/op/constant.hpp"
|
#include "openvino/op/constant.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
#include "openvino/opsets/opset2.hpp"
|
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -70,11 +71,11 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const SpaceToBatchParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const SpaceToBatchParams& params) {
|
||||||
const auto data = std::make_shared<opset1::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
const auto data = std::make_shared<op::v0::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
||||||
const auto blockShape = std::make_shared<opset1::Parameter>(element::i64, params.blockShapeTensor.shape);
|
const auto blockShape = std::make_shared<op::v0::Parameter>(element::i64, params.blockShapeTensor.shape);
|
||||||
const auto padsBegin = std::make_shared<opset1::Parameter>(element::i64, params.padsBeginTensor.shape);
|
const auto padsBegin = std::make_shared<op::v0::Parameter>(element::i64, params.padsBeginTensor.shape);
|
||||||
const auto padsEnd = std::make_shared<opset1::Parameter>(element::i64, params.padsEndTensor.shape);
|
const auto padsEnd = std::make_shared<op::v0::Parameter>(element::i64, params.padsEndTensor.shape);
|
||||||
const auto batchToSpace = std::make_shared<opset2::SpaceToBatch>(data, blockShape, padsBegin, padsEnd);
|
const auto batchToSpace = std::make_shared<op::v1::SpaceToBatch>(data, blockShape, padsBegin, padsEnd);
|
||||||
return std::make_shared<ov::Model>(NodeVector{batchToSpace},
|
return std::make_shared<ov::Model>(NodeVector{batchToSpace},
|
||||||
ParameterVector{data, blockShape, padsBegin, padsEnd});
|
ParameterVector{data, blockShape, padsBegin, padsEnd});
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,12 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/space_to_depth.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -56,11 +58,10 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const SpaceToDepthParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const SpaceToDepthParams& params) {
|
||||||
opset1::SpaceToDepth::SpaceToDepthMode mode = params.mode == "DEPTH_FIRST"
|
const auto mode = params.mode == "DEPTH_FIRST" ? op::v0::SpaceToDepth::SpaceToDepthMode::DEPTH_FIRST
|
||||||
? opset1::SpaceToDepth::SpaceToDepthMode::DEPTH_FIRST
|
: op::v0::SpaceToDepth::SpaceToDepthMode::BLOCKS_FIRST;
|
||||||
: opset1::SpaceToDepth::SpaceToDepthMode::BLOCKS_FIRST;
|
const auto data = std::make_shared<op::v0::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
||||||
const auto data = std::make_shared<opset1::Parameter>(params.dataTensor.type, params.dataTensor.shape);
|
const auto SpaceToDepth = std::make_shared<op::v0::SpaceToDepth>(data, mode, params.blockSize);
|
||||||
const auto SpaceToDepth = std::make_shared<opset1::SpaceToDepth>(data, mode, params.blockSize);
|
|
||||||
return std::make_shared<Model>(NodeVector{SpaceToDepth}, ParameterVector{data});
|
return std::make_shared<Model>(NodeVector{SpaceToDepth}, ParameterVector{data});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -2,13 +2,23 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include "openvino/op/tensor_iterator.hpp"
|
||||||
|
|
||||||
#include <openvino/core/model.hpp>
|
#include <gtest/gtest.h>
|
||||||
#include <openvino/opsets/opset8.hpp>
|
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "functional_test_utils/skip_tests_config.hpp"
|
#include "functional_test_utils/skip_tests_config.hpp"
|
||||||
|
#include "openvino/core/model.hpp"
|
||||||
|
#include "openvino/op/add.hpp"
|
||||||
|
#include "openvino/op/constant.hpp"
|
||||||
|
#include "openvino/op/gru_cell.hpp"
|
||||||
|
#include "openvino/op/lstm_cell.hpp"
|
||||||
|
#include "openvino/op/multiply.hpp"
|
||||||
|
#include "openvino/op/parameter.hpp"
|
||||||
|
#include "openvino/op/result.hpp"
|
||||||
|
#include "openvino/op/rnn_cell.hpp"
|
||||||
|
#include "openvino/op/squeeze.hpp"
|
||||||
|
#include "openvino/op/unsqueeze.hpp"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct TIFunctionalBase {
|
struct TIFunctionalBase {
|
||||||
@ -23,26 +33,26 @@ struct TIFunctionalBase {
|
|||||||
struct TIDynamicInputs : public TIFunctionalBase {
|
struct TIDynamicInputs : public TIFunctionalBase {
|
||||||
std::shared_ptr<ov::Model> create_function(const std::vector<reference_tests::Tensor>& ti_inputs,
|
std::shared_ptr<ov::Model> create_function(const std::vector<reference_tests::Tensor>& ti_inputs,
|
||||||
const std::vector<reference_tests::Tensor>& results) override {
|
const std::vector<reference_tests::Tensor>& results) override {
|
||||||
auto X = std::make_shared<ov::opset8::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
auto X = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
||||||
auto Y = std::make_shared<ov::opset8::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
auto Y = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
||||||
auto M = std::make_shared<ov::opset8::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
auto M = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
||||||
|
|
||||||
// Set up the cell body, a function from (Xi, Yi) -> (Zo)
|
// Set up the cell body, a function from (Xi, Yi) -> (Zo)
|
||||||
// Body parameters
|
// Body parameters
|
||||||
auto Xi = std::make_shared<ov::opset8::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
auto Xi = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
||||||
auto Yi = std::make_shared<ov::opset8::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
auto Yi = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
||||||
auto M_body = std::make_shared<ov::opset8::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
auto M_body = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape::dynamic());
|
||||||
auto body_condition = std::make_shared<ov::opset8::Constant>(ov::element::boolean, ov::Shape{1}, true);
|
auto body_condition = std::make_shared<ov::op::v0::Constant>(ov::element::boolean, ov::Shape{1}, true);
|
||||||
|
|
||||||
auto trip_count = std::make_shared<ov::opset8::Constant>(ov::element::i64, ov::Shape{1}, 3);
|
auto trip_count = std::make_shared<ov::op::v0::Constant>(ov::element::i64, ov::Shape{1}, 3);
|
||||||
auto exec_condition = std::make_shared<ov::opset8::Constant>(ov::element::boolean, ov::Shape{1}, true);
|
auto exec_condition = std::make_shared<ov::op::v0::Constant>(ov::element::boolean, ov::Shape{1}, true);
|
||||||
// Body
|
// Body
|
||||||
auto sum = std::make_shared<ov::opset8::Add>(Xi, Yi);
|
auto sum = std::make_shared<ov::op::v1::Add>(Xi, Yi);
|
||||||
auto Zo = std::make_shared<ov::opset8::Multiply>(sum, M_body);
|
auto Zo = std::make_shared<ov::op::v1::Multiply>(sum, M_body);
|
||||||
auto body =
|
auto body =
|
||||||
std::make_shared<ov::Model>(ov::OutputVector{body_condition, Zo}, ov::ParameterVector{Xi, Yi, M_body});
|
std::make_shared<ov::Model>(ov::OutputVector{body_condition, Zo}, ov::ParameterVector{Xi, Yi, M_body});
|
||||||
|
|
||||||
auto tensor_iterator = std::make_shared<ov::opset8::TensorIterator>();
|
auto tensor_iterator = std::make_shared<ov::op::v0::TensorIterator>();
|
||||||
tensor_iterator->set_function(body);
|
tensor_iterator->set_function(body);
|
||||||
|
|
||||||
tensor_iterator->set_sliced_input(Xi, X, 0, 1, 1, -1, 1);
|
tensor_iterator->set_sliced_input(Xi, X, 0, 1, 1, -1, 1);
|
||||||
@ -257,14 +267,14 @@ struct TIStaticInputs : public TIStaticFunctionalBase {
|
|||||||
std::shared_ptr<ov::Model> create_function(const TensorIteratorStaticParams& params) override {
|
std::shared_ptr<ov::Model> create_function(const TensorIteratorStaticParams& params) override {
|
||||||
std::vector<ov::Shape> inputShapes;
|
std::vector<ov::Shape> inputShapes;
|
||||||
std::shared_ptr<ov::Model> function;
|
std::shared_ptr<ov::Model> function;
|
||||||
auto tensor_iterator = std::make_shared<ov::opset8::TensorIterator>();
|
auto tensor_iterator = std::make_shared<ov::op::v0::TensorIterator>();
|
||||||
|
|
||||||
// Each case consist of 3 steps:
|
// Each case consist of 3 steps:
|
||||||
// 1. Create TensorIterator body.
|
// 1. Create TensorIterator body.
|
||||||
// 2. Set PortMap
|
// 2. Set PortMap
|
||||||
// 3. Create outer function
|
// 3. Create outer function
|
||||||
auto axis =
|
auto axis =
|
||||||
std::make_shared<ov::opset8::Constant>(ov::element::i64,
|
std::make_shared<ov::op::v0::Constant>(ov::element::i64,
|
||||||
ov::Shape{1},
|
ov::Shape{1},
|
||||||
std::vector<int64_t>{static_cast<int64_t>(params.sequenceAxis)});
|
std::vector<int64_t>{static_cast<int64_t>(params.sequenceAxis)});
|
||||||
switch (params.body_type) {
|
switch (params.body_type) {
|
||||||
@ -290,13 +300,13 @@ struct TIStaticInputs : public TIStaticFunctionalBase {
|
|||||||
ov::ParameterVector body_params{std::make_shared<ov::op::v0::Parameter>(params.iType, inputShapes[0]),
|
ov::ParameterVector body_params{std::make_shared<ov::op::v0::Parameter>(params.iType, inputShapes[0]),
|
||||||
std::make_shared<ov::op::v0::Parameter>(params.iType, inputShapes[1]),
|
std::make_shared<ov::op::v0::Parameter>(params.iType, inputShapes[1]),
|
||||||
std::make_shared<ov::op::v0::Parameter>(params.iType, inputShapes[2])};
|
std::make_shared<ov::op::v0::Parameter>(params.iType, inputShapes[2])};
|
||||||
auto squeeze = std::make_shared<ov::opset8::Squeeze>(body_params[0], axis);
|
auto squeeze = std::make_shared<ov::op::v0::Squeeze>(body_params[0], axis);
|
||||||
ov::OutputVector out_vector = {squeeze, body_params[1], body_params[2]};
|
ov::OutputVector out_vector = {squeeze, body_params[1], body_params[2]};
|
||||||
|
|
||||||
auto W = std::make_shared<ov::opset8::Constant>(params.W.type, params.W.shape, params.W.data.data());
|
auto W = std::make_shared<ov::op::v0::Constant>(params.W.type, params.W.shape, params.W.data.data());
|
||||||
auto R = std::make_shared<ov::opset8::Constant>(params.R.type, params.R.shape, params.R.data.data());
|
auto R = std::make_shared<ov::op::v0::Constant>(params.R.type, params.R.shape, params.R.data.data());
|
||||||
auto B = std::make_shared<ov::opset8::Constant>(params.B.type, params.B.shape, params.B.data.data());
|
auto B = std::make_shared<ov::op::v0::Constant>(params.B.type, params.B.shape, params.B.data.data());
|
||||||
auto lstm_cell = std::make_shared<ov::opset8::LSTMCell>(out_vector[0],
|
auto lstm_cell = std::make_shared<ov::op::v4::LSTMCell>(out_vector[0],
|
||||||
out_vector[1],
|
out_vector[1],
|
||||||
out_vector[2],
|
out_vector[2],
|
||||||
W,
|
W,
|
||||||
@ -308,10 +318,10 @@ struct TIStaticInputs : public TIStaticFunctionalBase {
|
|||||||
std::vector<float>{},
|
std::vector<float>{},
|
||||||
params.clip);
|
params.clip);
|
||||||
|
|
||||||
auto unsqueeze = std::make_shared<ov::opset8::Unsqueeze>(lstm_cell->output(0), axis);
|
auto unsqueeze = std::make_shared<ov::op::v0::Unsqueeze>(lstm_cell->output(0), axis);
|
||||||
ov::ResultVector results{std::make_shared<ov::opset8::Result>(unsqueeze),
|
ov::ResultVector results{std::make_shared<ov::op::v0::Result>(unsqueeze),
|
||||||
std::make_shared<ov::opset8::Result>(lstm_cell->output(0)),
|
std::make_shared<ov::op::v0::Result>(lstm_cell->output(0)),
|
||||||
std::make_shared<ov::opset8::Result>(lstm_cell->output(1))};
|
std::make_shared<ov::op::v0::Result>(lstm_cell->output(1))};
|
||||||
auto body = std::make_shared<ov::Model>(results, body_params, "lstm_cell");
|
auto body = std::make_shared<ov::Model>(results, body_params, "lstm_cell");
|
||||||
tensor_iterator->set_function(body);
|
tensor_iterator->set_function(body);
|
||||||
|
|
||||||
@ -357,13 +367,13 @@ struct TIStaticInputs : public TIStaticFunctionalBase {
|
|||||||
ov::ParameterVector body_params{std::make_shared<ov::op::v0::Parameter>(params.iType, inputShapes[0]),
|
ov::ParameterVector body_params{std::make_shared<ov::op::v0::Parameter>(params.iType, inputShapes[0]),
|
||||||
std::make_shared<ov::op::v0::Parameter>(params.iType, inputShapes[1])};
|
std::make_shared<ov::op::v0::Parameter>(params.iType, inputShapes[1])};
|
||||||
|
|
||||||
auto squeeze = std::make_shared<ov::opset8::Squeeze>(body_params[0], axis);
|
auto squeeze = std::make_shared<ov::op::v0::Squeeze>(body_params[0], axis);
|
||||||
ov::OutputVector out_vector = {squeeze, body_params[1]};
|
ov::OutputVector out_vector = {squeeze, body_params[1]};
|
||||||
|
|
||||||
auto W = std::make_shared<ov::opset8::Constant>(params.W.type, params.W.shape, params.W.data.data());
|
auto W = std::make_shared<ov::op::v0::Constant>(params.W.type, params.W.shape, params.W.data.data());
|
||||||
auto R = std::make_shared<ov::opset8::Constant>(params.R.type, params.R.shape, params.R.data.data());
|
auto R = std::make_shared<ov::op::v0::Constant>(params.R.type, params.R.shape, params.R.data.data());
|
||||||
auto B = std::make_shared<ov::opset8::Constant>(params.B.type, params.B.shape, params.B.data.data());
|
auto B = std::make_shared<ov::op::v0::Constant>(params.B.type, params.B.shape, params.B.data.data());
|
||||||
auto gru_cell = std::make_shared<ov::opset8::GRUCell>(out_vector[0],
|
auto gru_cell = std::make_shared<ov::op::v3::GRUCell>(out_vector[0],
|
||||||
out_vector[1],
|
out_vector[1],
|
||||||
W,
|
W,
|
||||||
R,
|
R,
|
||||||
@ -375,9 +385,9 @@ struct TIStaticInputs : public TIStaticFunctionalBase {
|
|||||||
params.clip,
|
params.clip,
|
||||||
false);
|
false);
|
||||||
|
|
||||||
auto unsqueeze = std::make_shared<ov::opset8::Unsqueeze>(gru_cell->output(0), axis);
|
auto unsqueeze = std::make_shared<ov::op::v0::Unsqueeze>(gru_cell->output(0), axis);
|
||||||
ov::ResultVector results{std::make_shared<ov::opset8::Result>(gru_cell->output(0)),
|
ov::ResultVector results{std::make_shared<ov::op::v0::Result>(gru_cell->output(0)),
|
||||||
std::make_shared<ov::opset8::Result>(unsqueeze)};
|
std::make_shared<ov::op::v0::Result>(unsqueeze)};
|
||||||
auto body = std::make_shared<ov::Model>(results, body_params, "gru_cell");
|
auto body = std::make_shared<ov::Model>(results, body_params, "gru_cell");
|
||||||
tensor_iterator->set_function(body);
|
tensor_iterator->set_function(body);
|
||||||
|
|
||||||
@ -420,13 +430,13 @@ struct TIStaticInputs : public TIStaticFunctionalBase {
|
|||||||
inputShapes[0][params.sequenceAxis] = 1; // sliced dimension
|
inputShapes[0][params.sequenceAxis] = 1; // sliced dimension
|
||||||
ov::ParameterVector body_params{std::make_shared<ov::op::v0::Parameter>(params.iType, inputShapes[0]),
|
ov::ParameterVector body_params{std::make_shared<ov::op::v0::Parameter>(params.iType, inputShapes[0]),
|
||||||
std::make_shared<ov::op::v0::Parameter>(params.iType, inputShapes[1])};
|
std::make_shared<ov::op::v0::Parameter>(params.iType, inputShapes[1])};
|
||||||
auto squeeze = std::make_shared<ov::opset8::Squeeze>(body_params[0], axis);
|
auto squeeze = std::make_shared<ov::op::v0::Squeeze>(body_params[0], axis);
|
||||||
ov::OutputVector out_vector = {squeeze, body_params[1]};
|
ov::OutputVector out_vector = {squeeze, body_params[1]};
|
||||||
|
|
||||||
auto W = std::make_shared<ov::opset8::Constant>(params.W.type, params.W.shape, params.W.data.data());
|
auto W = std::make_shared<ov::op::v0::Constant>(params.W.type, params.W.shape, params.W.data.data());
|
||||||
auto R = std::make_shared<ov::opset8::Constant>(params.R.type, params.R.shape, params.R.data.data());
|
auto R = std::make_shared<ov::op::v0::Constant>(params.R.type, params.R.shape, params.R.data.data());
|
||||||
auto B = std::make_shared<ov::opset8::Constant>(params.B.type, params.B.shape, params.B.data.data());
|
auto B = std::make_shared<ov::op::v0::Constant>(params.B.type, params.B.shape, params.B.data.data());
|
||||||
auto rnn_cell = std::make_shared<ov::opset8::RNNCell>(out_vector[0],
|
auto rnn_cell = std::make_shared<ov::op::v0::RNNCell>(out_vector[0],
|
||||||
out_vector[1],
|
out_vector[1],
|
||||||
W,
|
W,
|
||||||
R,
|
R,
|
||||||
@ -437,9 +447,9 @@ struct TIStaticInputs : public TIStaticFunctionalBase {
|
|||||||
std::vector<float>{},
|
std::vector<float>{},
|
||||||
params.clip);
|
params.clip);
|
||||||
|
|
||||||
auto unsqueeze = std::make_shared<ov::opset8::Unsqueeze>(rnn_cell->output(0), axis);
|
auto unsqueeze = std::make_shared<ov::op::v0::Unsqueeze>(rnn_cell->output(0), axis);
|
||||||
ov::ResultVector results{std::make_shared<ov::opset8::Result>(rnn_cell),
|
ov::ResultVector results{std::make_shared<ov::op::v0::Result>(rnn_cell),
|
||||||
std::make_shared<ov::opset8::Result>(unsqueeze)};
|
std::make_shared<ov::op::v0::Result>(unsqueeze)};
|
||||||
auto body = std::make_shared<ov::Model>(results, body_params, "rnn_cell");
|
auto body = std::make_shared<ov::Model>(results, body_params, "rnn_cell");
|
||||||
tensor_iterator->set_function(body);
|
tensor_iterator->set_function(body);
|
||||||
|
|
||||||
|
@ -2,10 +2,13 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/tile.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/constant.hpp"
|
||||||
|
#include "openvino/op/parameter.hpp"
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -55,10 +58,10 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const TileParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const TileParams& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto repeats =
|
const auto repeats =
|
||||||
std::make_shared<opset1::Constant>(params.repeats.type, params.repeats.shape, params.repeats.data.data());
|
std::make_shared<op::v0::Constant>(params.repeats.type, params.repeats.shape, params.repeats.data.data());
|
||||||
const auto tile = std::make_shared<opset1::Tile>(A, repeats);
|
const auto tile = std::make_shared<op::v0::Tile>(A, repeats);
|
||||||
const auto f = std::make_shared<Model>(NodeVector{tile}, ParameterVector{A});
|
const auto f = std::make_shared<Model>(NodeVector{tile}, ParameterVector{A});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,13 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "openvino/op/topk.hpp"
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include "base_reference_test.hpp"
|
#include "base_reference_test.hpp"
|
||||||
#include "openvino/opsets/opset1.hpp"
|
#include "openvino/op/constant.hpp"
|
||||||
#include "openvino/opsets/opset11.hpp"
|
#include "openvino/op/parameter.hpp"
|
||||||
#include "openvino/opsets/opset3.hpp"
|
|
||||||
|
|
||||||
using namespace reference_tests;
|
using namespace reference_tests;
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
@ -17,8 +18,8 @@ struct TopKParams {
|
|||||||
TopKParams(const reference_tests::Tensor& A,
|
TopKParams(const reference_tests::Tensor& A,
|
||||||
const reference_tests::Tensor& k,
|
const reference_tests::Tensor& k,
|
||||||
const int64_t axis,
|
const int64_t axis,
|
||||||
const opset1::TopK::Mode mode,
|
const op::v1::TopK::Mode mode,
|
||||||
const opset1::TopK::SortType sort,
|
const op::v1::TopK::SortType sort,
|
||||||
const reference_tests::Tensor& result0,
|
const reference_tests::Tensor& result0,
|
||||||
const reference_tests::Tensor& result1,
|
const reference_tests::Tensor& result1,
|
||||||
const size_t outIdx,
|
const size_t outIdx,
|
||||||
@ -36,8 +37,8 @@ struct TopKParams {
|
|||||||
reference_tests::Tensor A;
|
reference_tests::Tensor A;
|
||||||
reference_tests::Tensor k;
|
reference_tests::Tensor k;
|
||||||
int64_t axis;
|
int64_t axis;
|
||||||
opset1::TopK::Mode mode;
|
op::v1::TopK::Mode mode;
|
||||||
opset1::TopK::SortType sort;
|
op::v1::TopK::SortType sort;
|
||||||
reference_tests::Tensor result0;
|
reference_tests::Tensor result0;
|
||||||
reference_tests::Tensor result1;
|
reference_tests::Tensor result1;
|
||||||
size_t outIdx;
|
size_t outIdx;
|
||||||
@ -116,17 +117,17 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const TopKParamsResnet50& params) {
|
static std::shared_ptr<Model> CreateFunction(const TopKParamsResnet50& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto B = std::make_shared<opset1::TopK>(A,
|
const auto B = std::make_shared<op::v1::TopK>(A,
|
||||||
opset1::Constant::create(element::i64, {}, {5}),
|
op::v0::Constant::create(element::i64, {}, {5}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES);
|
op::v1::TopK::SortType::SORT_VALUES);
|
||||||
const auto C = std::make_shared<opset1::TopK>(A,
|
const auto C = std::make_shared<op::v1::TopK>(A,
|
||||||
opset1::Constant::create(element::i64, {}, {1}),
|
op::v0::Constant::create(element::i64, {}, {1}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES);
|
op::v1::TopK::SortType::SORT_VALUES);
|
||||||
|
|
||||||
const auto out5_value = B->output(0);
|
const auto out5_value = B->output(0);
|
||||||
const auto out5_index = B->output(1);
|
const auto out5_index = B->output(1);
|
||||||
@ -247,9 +248,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const TopKParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const TopKParams& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
||||||
const auto B = std::make_shared<opset1::TopK>(A, k, params.axis, params.mode, params.sort);
|
const auto B = std::make_shared<op::v1::TopK>(A, k, params.axis, params.mode, params.sort);
|
||||||
const auto f = std::make_shared<Model>(B->outputs(), ParameterVector{A});
|
const auto f = std::make_shared<Model>(B->outputs(), ParameterVector{A});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -279,8 +280,8 @@ std::vector<TopKParams> generateParamsMaxMinSort() {
|
|||||||
}({128, 1000})),
|
}({128, 1000})),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{5}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{5}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::NONE,
|
op::v1::TopK::SortType::NONE,
|
||||||
reference_tests::Tensor(ET,
|
reference_tests::Tensor(ET,
|
||||||
{128, 5},
|
{128, 5},
|
||||||
[](std::vector<size_t> rshape, std::vector<size_t> shape) -> std::vector<T> {
|
[](std::vector<size_t> rshape, std::vector<size_t> shape) -> std::vector<T> {
|
||||||
@ -323,8 +324,8 @@ std::vector<TopKParams> generateParamsMaxMinSort() {
|
|||||||
}({128, 1000})),
|
}({128, 1000})),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{5}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{5}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::NONE,
|
op::v1::TopK::SortType::NONE,
|
||||||
reference_tests::Tensor(ET,
|
reference_tests::Tensor(ET,
|
||||||
{128, 5},
|
{128, 5},
|
||||||
[](std::vector<size_t> rshape) -> std::vector<T> {
|
[](std::vector<size_t> rshape) -> std::vector<T> {
|
||||||
@ -368,8 +369,8 @@ std::vector<TopKParams> generateParamsMaxMinSort() {
|
|||||||
}({128, 1000})),
|
}({128, 1000})),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{5}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{5}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET,
|
reference_tests::Tensor(ET,
|
||||||
{128, 5},
|
{128, 5},
|
||||||
[](std::vector<size_t> rshape, std::vector<size_t> shape) -> std::vector<T> {
|
[](std::vector<size_t> rshape, std::vector<size_t> shape) -> std::vector<T> {
|
||||||
@ -408,8 +409,8 @@ std::vector<TopKParams> generateParamsMaxMinSort() {
|
|||||||
}({128, 1000})),
|
}({128, 1000})),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{5}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{5}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET,
|
reference_tests::Tensor(ET,
|
||||||
{128, 5},
|
{128, 5},
|
||||||
[](std::vector<size_t> rshape) -> std::vector<T> {
|
[](std::vector<size_t> rshape) -> std::vector<T> {
|
||||||
@ -449,8 +450,8 @@ std::vector<TopKParams> generateParamsMaxMinSort() {
|
|||||||
}({128, 1000})),
|
}({128, 1000})),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{5}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{5}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_INDICES,
|
op::v1::TopK::SortType::SORT_INDICES,
|
||||||
reference_tests::Tensor(ET,
|
reference_tests::Tensor(ET,
|
||||||
{128, 5},
|
{128, 5},
|
||||||
[](std::vector<size_t> rshape, std::vector<size_t> shape) -> std::vector<T> {
|
[](std::vector<size_t> rshape, std::vector<size_t> shape) -> std::vector<T> {
|
||||||
@ -493,8 +494,8 @@ std::vector<TopKParams> generateParamsMaxMinSort() {
|
|||||||
}({128, 1000})),
|
}({128, 1000})),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{5}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{5}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_INDICES,
|
op::v1::TopK::SortType::SORT_INDICES,
|
||||||
reference_tests::Tensor(ET,
|
reference_tests::Tensor(ET,
|
||||||
{128, 5},
|
{128, 5},
|
||||||
[](std::vector<size_t> rshape) -> std::vector<T> {
|
[](std::vector<size_t> rshape) -> std::vector<T> {
|
||||||
@ -523,8 +524,8 @@ std::vector<TopKParams> generateParamsMaxMinSort() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {5}, std::vector<T>{3, 1, 2, 5, 4}),
|
TopKParams(reference_tests::Tensor(ET, {5}, std::vector<T>{3, 1, 2, 5, 4}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {3}, std::vector<T>{5, 4, 3}),
|
reference_tests::Tensor(ET, {3}, std::vector<T>{5, 4, 3}),
|
||||||
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{3, 4, 0}),
|
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{3, 4, 0}),
|
||||||
0,
|
0,
|
||||||
@ -533,8 +534,8 @@ std::vector<TopKParams> generateParamsMaxMinSort() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {5}, std::vector<T>{3, 1, 2, 5, 4}),
|
TopKParams(reference_tests::Tensor(ET, {5}, std::vector<T>{3, 1, 2, 5, 4}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_INDICES,
|
op::v1::TopK::SortType::SORT_INDICES,
|
||||||
reference_tests::Tensor(ET, {3}, std::vector<T>{3, 5, 4}),
|
reference_tests::Tensor(ET, {3}, std::vector<T>{3, 5, 4}),
|
||||||
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{0, 3, 4}),
|
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{0, 3, 4}),
|
||||||
0,
|
0,
|
||||||
@ -543,8 +544,8 @@ std::vector<TopKParams> generateParamsMaxMinSort() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {5}, std::vector<T>{3, 1, 2, 5, 4}),
|
TopKParams(reference_tests::Tensor(ET, {5}, std::vector<T>{3, 1, 2, 5, 4}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {3}, std::vector<T>{1, 2, 3}),
|
reference_tests::Tensor(ET, {3}, std::vector<T>{1, 2, 3}),
|
||||||
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{1, 2, 0}),
|
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{1, 2, 0}),
|
||||||
0,
|
0,
|
||||||
@ -553,8 +554,8 @@ std::vector<TopKParams> generateParamsMaxMinSort() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {5}, std::vector<T>{3, 1, 2, 5, 4}),
|
TopKParams(reference_tests::Tensor(ET, {5}, std::vector<T>{3, 1, 2, 5, 4}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_INDICES,
|
op::v1::TopK::SortType::SORT_INDICES,
|
||||||
reference_tests::Tensor(ET, {3}, std::vector<T>{3, 1, 2}),
|
reference_tests::Tensor(ET, {3}, std::vector<T>{3, 1, 2}),
|
||||||
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{0, 1, 2}),
|
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{0, 1, 2}),
|
||||||
0,
|
0,
|
||||||
@ -602,9 +603,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const TopKParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const TopKParams& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
||||||
const auto B = std::make_shared<opset1::TopK>(A, k, params.axis, params.mode, params.sort);
|
const auto B = std::make_shared<op::v1::TopK>(A, k, params.axis, params.mode, params.sort);
|
||||||
const auto f = std::make_shared<Model>(B->outputs(), ParameterVector{A});
|
const auto f = std::make_shared<Model>(B->outputs(), ParameterVector{A});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -674,9 +675,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const TopKParams& params, size_t out_idx) {
|
static std::shared_ptr<Model> CreateFunction(const TopKParams& params, size_t out_idx) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
||||||
const auto B = std::make_shared<opset1::TopK>(A, k, params.axis, params.mode, params.sort);
|
const auto B = std::make_shared<op::v1::TopK>(A, k, params.axis, params.mode, params.sort);
|
||||||
const auto f = std::make_shared<Model>(OutputVector{B->output(out_idx)}, ParameterVector{A});
|
const auto f = std::make_shared<Model>(OutputVector{B->output(out_idx)}, ParameterVector{A});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -695,8 +696,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{6}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{6}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
||||||
reference_tests::Tensor(ET_OUT, {6}, std::vector<T_OUT>{5, 4, 3, 2, 1, 0}),
|
reference_tests::Tensor(ET_OUT, {6}, std::vector<T_OUT>{5, 4, 3, 2, 1, 0}),
|
||||||
0,
|
0,
|
||||||
@ -705,8 +706,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{6}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{6}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
||||||
reference_tests::Tensor(ET_OUT, {6}, std::vector<T_OUT>{5, 4, 3, 2, 1, 0}),
|
reference_tests::Tensor(ET_OUT, {6}, std::vector<T_OUT>{5, 4, 3, 2, 1, 0}),
|
||||||
1,
|
1,
|
||||||
@ -715,8 +716,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {3}, std::vector<T>{6, 5, 4}),
|
reference_tests::Tensor(ET, {3}, std::vector<T>{6, 5, 4}),
|
||||||
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{5, 4, 3}),
|
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{5, 4, 3}),
|
||||||
0,
|
0,
|
||||||
@ -725,8 +726,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {3}, std::vector<T>{6, 5, 4}),
|
reference_tests::Tensor(ET, {3}, std::vector<T>{6, 5, 4}),
|
||||||
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{5, 4, 3}),
|
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{5, 4, 3}),
|
||||||
1,
|
1,
|
||||||
@ -735,8 +736,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {1}, std::vector<T>{6}),
|
reference_tests::Tensor(ET, {1}, std::vector<T>{6}),
|
||||||
reference_tests::Tensor(ET_OUT, {1}, std::vector<T_OUT>{5}),
|
reference_tests::Tensor(ET_OUT, {1}, std::vector<T_OUT>{5}),
|
||||||
0,
|
0,
|
||||||
@ -745,8 +746,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {1}, std::vector<T>{6}),
|
reference_tests::Tensor(ET, {1}, std::vector<T>{6}),
|
||||||
reference_tests::Tensor(ET_OUT, {1}, std::vector<T_OUT>{5}),
|
reference_tests::Tensor(ET_OUT, {1}, std::vector<T_OUT>{5}),
|
||||||
1,
|
1,
|
||||||
@ -755,8 +756,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{6}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{6}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
||||||
reference_tests::Tensor(ET_OUT, {6}, std::vector<T_OUT>{5, 4, 3, 2, 1, 0}),
|
reference_tests::Tensor(ET_OUT, {6}, std::vector<T_OUT>{5, 4, 3, 2, 1, 0}),
|
||||||
0,
|
0,
|
||||||
@ -765,8 +766,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{6}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{6}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
reference_tests::Tensor(ET, {6}, std::vector<T>{1, 2, 3, 4, 5, 6}),
|
||||||
reference_tests::Tensor(ET_OUT, {6}, std::vector<T_OUT>{5, 4, 3, 2, 1, 0}),
|
reference_tests::Tensor(ET_OUT, {6}, std::vector<T_OUT>{5, 4, 3, 2, 1, 0}),
|
||||||
1,
|
1,
|
||||||
@ -775,8 +776,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {3}, std::vector<T>{1, 2, 3}),
|
reference_tests::Tensor(ET, {3}, std::vector<T>{1, 2, 3}),
|
||||||
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{5, 4, 3}),
|
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{5, 4, 3}),
|
||||||
0,
|
0,
|
||||||
@ -785,8 +786,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {3}, std::vector<T>{1, 2, 3}),
|
reference_tests::Tensor(ET, {3}, std::vector<T>{1, 2, 3}),
|
||||||
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{5, 4, 3}),
|
reference_tests::Tensor(ET_OUT, {3}, std::vector<T_OUT>{5, 4, 3}),
|
||||||
1,
|
1,
|
||||||
@ -795,8 +796,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {1}, std::vector<T>{1}),
|
reference_tests::Tensor(ET, {1}, std::vector<T>{1}),
|
||||||
reference_tests::Tensor(ET_OUT, {1}, std::vector<T_OUT>{5}),
|
reference_tests::Tensor(ET_OUT, {1}, std::vector<T_OUT>{5}),
|
||||||
0,
|
0,
|
||||||
@ -805,8 +806,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
TopKParams(reference_tests::Tensor(ET, {6}, std::vector<T>{6, 5, 4, 3, 2, 1}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {1}, std::vector<T>{1}),
|
reference_tests::Tensor(ET, {1}, std::vector<T>{1}),
|
||||||
reference_tests::Tensor(ET_OUT, {1}, std::vector<T_OUT>{5}),
|
reference_tests::Tensor(ET_OUT, {1}, std::vector<T_OUT>{5}),
|
||||||
1,
|
1,
|
||||||
@ -815,8 +816,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{10, 12, 9, 4, 8, 2, 11, 7, 6, 3, 5, 1}),
|
reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{10, 12, 9, 4, 8, 2, 11, 7, 6, 3, 5, 1}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector<T_OUT>{1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0}),
|
reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector<T_OUT>{1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0}),
|
||||||
0,
|
0,
|
||||||
@ -825,8 +826,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{10, 12, 9, 4, 8, 2, 11, 7, 6, 3, 5, 1}),
|
reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{10, 12, 9, 4, 8, 2, 11, 7, 6, 3, 5, 1}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector<T_OUT>{1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0}),
|
reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector<T_OUT>{1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0}),
|
||||||
1,
|
1,
|
||||||
@ -854,8 +855,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
215, 287, 200, 272, 208, 280, 216, 288}),
|
215, 287, 200, 272, 208, 280, 216, 288}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(
|
reference_tests::Tensor(
|
||||||
ET,
|
ET,
|
||||||
{2, 2, 3, 2, 4},
|
{2, 2, 3, 2, 4},
|
||||||
@ -897,8 +898,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
215, 287, 200, 272, 208, 280, 216, 288}),
|
215, 287, 200, 272, 208, 280, 216, 288}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(
|
reference_tests::Tensor(
|
||||||
ET,
|
ET,
|
||||||
{2, 2, 3, 2, 4},
|
{2, 2, 3, 2, 4},
|
||||||
@ -921,8 +922,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 2, 2}, std::vector<T>{10, 12, 9, 4, 11, 7, 6, 3}),
|
reference_tests::Tensor(ET, {2, 2, 2}, std::vector<T>{10, 12, 9, 4, 11, 7, 6, 3}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector<T_OUT>{1, 1, 0, 2, 2, 2, 0, 1}),
|
reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector<T_OUT>{1, 1, 0, 2, 2, 2, 0, 1}),
|
||||||
0,
|
0,
|
||||||
@ -931,8 +932,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 2, 2}, std::vector<T>{10, 12, 9, 4, 11, 7, 6, 3}),
|
reference_tests::Tensor(ET, {2, 2, 2}, std::vector<T>{10, 12, 9, 4, 11, 7, 6, 3}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector<T_OUT>{1, 1, 0, 2, 2, 2, 0, 1}),
|
reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector<T_OUT>{1, 1, 0, 2, 2, 2, 0, 1}),
|
||||||
1,
|
1,
|
||||||
@ -941,8 +942,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 1, 2}, std::vector<T>{10, 12, 11, 7}),
|
reference_tests::Tensor(ET, {2, 1, 2}, std::vector<T>{10, 12, 11, 7}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 1, 2}, std::vector<T_OUT>{1, 1, 2, 2}),
|
reference_tests::Tensor(ET_OUT, {2, 1, 2}, std::vector<T_OUT>{1, 1, 2, 2}),
|
||||||
0,
|
0,
|
||||||
@ -951,8 +952,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 1, 2}, std::vector<T>{10, 12, 11, 7}),
|
reference_tests::Tensor(ET, {2, 1, 2}, std::vector<T>{10, 12, 11, 7}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 1, 2}, std::vector<T_OUT>{1, 1, 2, 2}),
|
reference_tests::Tensor(ET_OUT, {2, 1, 2}, std::vector<T_OUT>{1, 1, 2, 2}),
|
||||||
1,
|
1,
|
||||||
@ -961,8 +962,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{8, 2, 10, 4, 12, 9, 5, 1, 6, 3, 11, 7}),
|
reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{8, 2, 10, 4, 12, 9, 5, 1, 6, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector<T_OUT>{2, 0, 1, 2, 0, 1, 1, 0, 0, 1, 2, 2}),
|
reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector<T_OUT>{2, 0, 1, 2, 0, 1, 1, 0, 0, 1, 2, 2}),
|
||||||
0,
|
0,
|
||||||
@ -971,8 +972,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{8, 2, 10, 4, 12, 9, 5, 1, 6, 3, 11, 7}),
|
reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{8, 2, 10, 4, 12, 9, 5, 1, 6, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector<T_OUT>{2, 0, 1, 2, 0, 1, 1, 0, 0, 1, 2, 2}),
|
reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector<T_OUT>{2, 0, 1, 2, 0, 1, 1, 0, 0, 1, 2, 2}),
|
||||||
1,
|
1,
|
||||||
@ -981,8 +982,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 2, 2}, std::vector<T>{8, 2, 10, 4, 5, 1, 6, 3}),
|
reference_tests::Tensor(ET, {2, 2, 2}, std::vector<T>{8, 2, 10, 4, 5, 1, 6, 3}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector<T_OUT>{2, 0, 1, 2, 1, 0, 0, 1}),
|
reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector<T_OUT>{2, 0, 1, 2, 1, 0, 0, 1}),
|
||||||
0,
|
0,
|
||||||
@ -991,8 +992,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 2, 2}, std::vector<T>{8, 2, 10, 4, 5, 1, 6, 3}),
|
reference_tests::Tensor(ET, {2, 2, 2}, std::vector<T>{8, 2, 10, 4, 5, 1, 6, 3}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector<T_OUT>{2, 0, 1, 2, 1, 0, 0, 1}),
|
reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector<T_OUT>{2, 0, 1, 2, 1, 0, 0, 1}),
|
||||||
1,
|
1,
|
||||||
@ -1001,8 +1002,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 1, 2}, std::vector<T>{8, 2, 5, 1}),
|
reference_tests::Tensor(ET, {2, 1, 2}, std::vector<T>{8, 2, 5, 1}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 1, 2}, std::vector<T_OUT>{2, 0, 1, 0}),
|
reference_tests::Tensor(ET_OUT, {2, 1, 2}, std::vector<T_OUT>{2, 0, 1, 0}),
|
||||||
0,
|
0,
|
||||||
@ -1011,8 +1012,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 1, 2}, std::vector<T>{8, 2, 5, 1}),
|
reference_tests::Tensor(ET, {2, 1, 2}, std::vector<T>{8, 2, 5, 1}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 1, 2}, std::vector<T_OUT>{2, 0, 1, 0}),
|
reference_tests::Tensor(ET_OUT, {2, 1, 2}, std::vector<T_OUT>{2, 0, 1, 0}),
|
||||||
1,
|
1,
|
||||||
@ -1021,8 +1022,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{4}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{4}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 11, 10, 9, 8, 7, 6, 2, 5, 3, 1, 4}),
|
reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 11, 10, 9, 8, 7, 6, 2, 5, 3, 1, 4}),
|
||||||
reference_tests::Tensor(ET_OUT, {4, 3}, std::vector<T_OUT>{1, 3, 0, 0, 1, 3, 2, 0, 2, 3, 2, 1}),
|
reference_tests::Tensor(ET_OUT, {4, 3}, std::vector<T_OUT>{1, 3, 0, 0, 1, 3, 2, 0, 2, 3, 2, 1}),
|
||||||
0,
|
0,
|
||||||
@ -1031,8 +1032,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{4}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{4}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 11, 10, 9, 8, 7, 6, 2, 5, 3, 1, 4}),
|
reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 11, 10, 9, 8, 7, 6, 2, 5, 3, 1, 4}),
|
||||||
reference_tests::Tensor(ET_OUT, {4, 3}, std::vector<T_OUT>{1, 3, 0, 0, 1, 3, 2, 0, 2, 3, 2, 1}),
|
reference_tests::Tensor(ET_OUT, {4, 3}, std::vector<T_OUT>{1, 3, 0, 0, 1, 3, 2, 0, 2, 3, 2, 1}),
|
||||||
1,
|
1,
|
||||||
@ -1041,8 +1042,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 3}, std::vector<T>{12, 11, 10, 9, 8, 7}),
|
reference_tests::Tensor(ET, {2, 3}, std::vector<T>{12, 11, 10, 9, 8, 7}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 3}, std::vector<T_OUT>{1, 3, 0, 0, 1, 3}),
|
reference_tests::Tensor(ET_OUT, {2, 3}, std::vector<T_OUT>{1, 3, 0, 0, 1, 3}),
|
||||||
0,
|
0,
|
||||||
@ -1051,8 +1052,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 3}, std::vector<T>{12, 11, 10, 9, 8, 7}),
|
reference_tests::Tensor(ET, {2, 3}, std::vector<T>{12, 11, 10, 9, 8, 7}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 3}, std::vector<T_OUT>{1, 3, 0, 0, 1, 3}),
|
reference_tests::Tensor(ET_OUT, {2, 3}, std::vector<T_OUT>{1, 3, 0, 0, 1, 3}),
|
||||||
1,
|
1,
|
||||||
@ -1061,8 +1062,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {1, 3}, std::vector<T>{12, 11, 10}),
|
reference_tests::Tensor(ET, {1, 3}, std::vector<T>{12, 11, 10}),
|
||||||
reference_tests::Tensor(ET_OUT, {1, 3}, std::vector<T_OUT>{1, 3, 0}),
|
reference_tests::Tensor(ET_OUT, {1, 3}, std::vector<T_OUT>{1, 3, 0}),
|
||||||
0,
|
0,
|
||||||
@ -1071,8 +1072,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {1, 3}, std::vector<T>{12, 11, 10}),
|
reference_tests::Tensor(ET, {1, 3}, std::vector<T>{12, 11, 10}),
|
||||||
reference_tests::Tensor(ET_OUT, {1, 3}, std::vector<T_OUT>{1, 3, 0}),
|
reference_tests::Tensor(ET_OUT, {1, 3}, std::vector<T_OUT>{1, 3, 0}),
|
||||||
1,
|
1,
|
||||||
@ -1081,8 +1082,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 4}, std::vector<T>{1, 3, 2, 4, 1, 3, 3, 2}),
|
TopKParams(reference_tests::Tensor(ET, {2, 4}, std::vector<T>{1, 3, 2, 4, 1, 3, 3, 2}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 1}, std::vector<T>{4, 3}),
|
reference_tests::Tensor(ET, {2, 1}, std::vector<T>{4, 3}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 1}, std::vector<T_OUT>{3, 1}),
|
reference_tests::Tensor(ET_OUT, {2, 1}, std::vector<T_OUT>{3, 1}),
|
||||||
0,
|
0,
|
||||||
@ -1091,8 +1092,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 4}, std::vector<T>{1, 3, 2, 4, 1, 3, 3, 2}),
|
TopKParams(reference_tests::Tensor(ET, {2, 4}, std::vector<T>{1, 3, 2, 4, 1, 3, 3, 2}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 1}, std::vector<T>{4, 3}),
|
reference_tests::Tensor(ET, {2, 1}, std::vector<T>{4, 3}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 1}, std::vector<T_OUT>{3, 1}),
|
reference_tests::Tensor(ET_OUT, {2, 1}, std::vector<T_OUT>{3, 1}),
|
||||||
1,
|
1,
|
||||||
@ -1101,8 +1102,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{4}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{4}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {4, 3}, std::vector<T>{3, 1, 4, 6, 2, 5, 9, 8, 7, 12, 11, 10}),
|
reference_tests::Tensor(ET, {4, 3}, std::vector<T>{3, 1, 4, 6, 2, 5, 9, 8, 7, 12, 11, 10}),
|
||||||
reference_tests::Tensor(ET_OUT, {4, 3}, std::vector<T_OUT>{3, 2, 1, 2, 0, 2, 1, 1, 3, 0, 3, 0}),
|
reference_tests::Tensor(ET_OUT, {4, 3}, std::vector<T_OUT>{3, 2, 1, 2, 0, 2, 1, 1, 3, 0, 3, 0}),
|
||||||
0,
|
0,
|
||||||
@ -1111,8 +1112,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{4}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{4}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {4, 3}, std::vector<T>{3, 1, 4, 6, 2, 5, 9, 8, 7, 12, 11, 10}),
|
reference_tests::Tensor(ET, {4, 3}, std::vector<T>{3, 1, 4, 6, 2, 5, 9, 8, 7, 12, 11, 10}),
|
||||||
reference_tests::Tensor(ET_OUT, {4, 3}, std::vector<T_OUT>{3, 2, 1, 2, 0, 2, 1, 1, 3, 0, 3, 0}),
|
reference_tests::Tensor(ET_OUT, {4, 3}, std::vector<T_OUT>{3, 2, 1, 2, 0, 2, 1, 1, 3, 0, 3, 0}),
|
||||||
1,
|
1,
|
||||||
@ -1121,8 +1122,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 3}, std::vector<T>{3, 1, 4, 6, 2, 5}),
|
reference_tests::Tensor(ET, {2, 3}, std::vector<T>{3, 1, 4, 6, 2, 5}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 3}, std::vector<T_OUT>{3, 2, 1, 2, 0, 2}),
|
reference_tests::Tensor(ET_OUT, {2, 3}, std::vector<T_OUT>{3, 2, 1, 2, 0, 2}),
|
||||||
0,
|
0,
|
||||||
@ -1131,8 +1132,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 3}, std::vector<T>{3, 1, 4, 6, 2, 5}),
|
reference_tests::Tensor(ET, {2, 3}, std::vector<T>{3, 1, 4, 6, 2, 5}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 3}, std::vector<T_OUT>{3, 2, 1, 2, 0, 2}),
|
reference_tests::Tensor(ET_OUT, {2, 3}, std::vector<T_OUT>{3, 2, 1, 2, 0, 2}),
|
||||||
1,
|
1,
|
||||||
@ -1141,8 +1142,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::NONE,
|
op::v1::TopK::SortType::NONE,
|
||||||
reference_tests::Tensor(ET, {1, 3}, std::vector<T>{3, 1, 4}),
|
reference_tests::Tensor(ET, {1, 3}, std::vector<T>{3, 1, 4}),
|
||||||
reference_tests::Tensor(ET_OUT, {1, 3}, std::vector<T_OUT>{3, 2, 1}),
|
reference_tests::Tensor(ET_OUT, {1, 3}, std::vector<T_OUT>{3, 2, 1}),
|
||||||
0,
|
0,
|
||||||
@ -1151,8 +1152,8 @@ std::vector<TopKParams> generateParams1dMaxMin() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {4, 3}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{1}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::NONE,
|
op::v1::TopK::SortType::NONE,
|
||||||
reference_tests::Tensor(ET, {1, 3}, std::vector<T>{3, 1, 4}),
|
reference_tests::Tensor(ET, {1, 3}, std::vector<T>{3, 1, 4}),
|
||||||
reference_tests::Tensor(ET_OUT, {1, 3}, std::vector<T_OUT>{3, 2, 1}),
|
reference_tests::Tensor(ET_OUT, {1, 3}, std::vector<T_OUT>{3, 2, 1}),
|
||||||
1,
|
1,
|
||||||
@ -1190,9 +1191,9 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs,
|
|||||||
class ReferenceTopKTestInt64 : public ReferenceTopKTest1dMaxMin {
|
class ReferenceTopKTestInt64 : public ReferenceTopKTest1dMaxMin {
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const TopKParams& params, size_t out_idx) {
|
static std::shared_ptr<Model> CreateFunction(const TopKParams& params, size_t out_idx) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
||||||
const auto B = std::make_shared<opset1::TopK>(A, k, params.axis, params.mode, params.sort, element::i64);
|
const auto B = std::make_shared<op::v1::TopK>(A, k, params.axis, params.mode, params.sort, element::i64);
|
||||||
const auto f = std::make_shared<Model>(OutputVector{B->output(out_idx)}, ParameterVector{A});
|
const auto f = std::make_shared<Model>(OutputVector{B->output(out_idx)}, ParameterVector{A});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -1211,8 +1212,8 @@ std::vector<TopKParams> generateParamsInt64() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{10, 12, 9, 4, 8, 2, 11, 7, 6, 3, 5, 1}),
|
reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{10, 12, 9, 4, 8, 2, 11, 7, 6, 3, 5, 1}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector<T_OUT>{1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0}),
|
reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector<T_OUT>{1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0}),
|
||||||
0,
|
0,
|
||||||
@ -1220,8 +1221,8 @@ std::vector<TopKParams> generateParamsInt64() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{9, 2, 10, 12, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{10, 12, 9, 4, 8, 2, 11, 7, 6, 3, 5, 1}),
|
reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{10, 12, 9, 4, 8, 2, 11, 7, 6, 3, 5, 1}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector<T_OUT>{1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0}),
|
reference_tests::Tensor(ET_OUT, {2, 3, 2}, std::vector<T_OUT>{1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0}),
|
||||||
1,
|
1,
|
||||||
@ -1258,9 +1259,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const TopKParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const TopKParams& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
||||||
const auto B = std::make_shared<opset1::TopK>(A, k, params.axis, params.mode, params.sort);
|
const auto B = std::make_shared<op::v1::TopK>(A, k, params.axis, params.mode, params.sort);
|
||||||
const auto f = std::make_shared<Model>(OutputVector{B->output(1)}, ParameterVector{A});
|
const auto f = std::make_shared<Model>(OutputVector{B->output(1)}, ParameterVector{A});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -1279,8 +1280,8 @@ std::vector<TopKParams> generateParamsSingleOutput() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
TopKParams(reference_tests::Tensor(ET, {2, 3, 2}, std::vector<T>{12, 2, 10, 9, 8, 4, 6, 1, 5, 3, 11, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 2, 2}, std::vector<T>{}),
|
reference_tests::Tensor(ET, {2, 2, 2}, std::vector<T>{}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector<T_OUT>{2, 0, 1, 2, 1, 0, 0, 1}),
|
reference_tests::Tensor(ET_OUT, {2, 2, 2}, std::vector<T_OUT>{2, 0, 1, 2, 1, 0, 0, 1}),
|
||||||
0,
|
0,
|
||||||
@ -1318,36 +1319,36 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs,
|
|||||||
ReferenceTopKTest::getTestCaseName);
|
ReferenceTopKTest::getTestCaseName);
|
||||||
|
|
||||||
TEST(ReferenceTopKTestInvalid, topk_v1_invalid_strings) {
|
TEST(ReferenceTopKTestInvalid, topk_v1_invalid_strings) {
|
||||||
const auto data = std::make_shared<opset1::Parameter>(element::f32, Shape{1, 2, 3});
|
const auto data = std::make_shared<op::v0::Parameter>(element::f32, Shape{1, 2, 3});
|
||||||
const auto k = opset1::Constant::create(element::i64, Shape{}, {1});
|
const auto k = op::v0::Constant::create(element::i64, Shape{}, {1});
|
||||||
EXPECT_THROW(opset1::TopK(data, k, 0, "max", "invalid_mode"), ov::AssertFailure);
|
EXPECT_THROW(op::v1::TopK(data, k, 0, "max", "invalid_mode"), ov::AssertFailure);
|
||||||
EXPECT_THROW(opset1::TopK(data, k, 0, "invalid_sort", "index"), ov::AssertFailure);
|
EXPECT_THROW(op::v1::TopK(data, k, 0, "invalid_sort", "index"), ov::AssertFailure);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(ReferenceTopKTestInvalid, topk_v1_invalid_k) {
|
TEST(ReferenceTopKTestInvalid, topk_v1_invalid_k) {
|
||||||
const auto data = std::make_shared<opset1::Parameter>(element::f32, Shape{1, 2, 3});
|
const auto data = std::make_shared<op::v0::Parameter>(element::f32, Shape{1, 2, 3});
|
||||||
const auto k_non_scalar = opset1::Constant::create(element::i64, Shape{2}, {1, 2});
|
const auto k_non_scalar = op::v0::Constant::create(element::i64, Shape{2}, {1, 2});
|
||||||
EXPECT_THROW(opset1::TopK(data, k_non_scalar, 0, "max", "index"), ov::NodeValidationFailure);
|
EXPECT_THROW(op::v1::TopK(data, k_non_scalar, 0, "max", "index"), ov::NodeValidationFailure);
|
||||||
const auto k_float = opset1::Constant::create(element::f32, Shape{}, {1.0f});
|
const auto k_float = op::v0::Constant::create(element::f32, Shape{}, {1.0f});
|
||||||
EXPECT_THROW(opset1::TopK(data, k_float, 0, "max", "index"), ov::NodeValidationFailure);
|
EXPECT_THROW(op::v1::TopK(data, k_float, 0, "max", "index"), ov::NodeValidationFailure);
|
||||||
const auto k_negative = opset1::Constant::create(element::i8, Shape{}, {-1});
|
const auto k_negative = op::v0::Constant::create(element::i8, Shape{}, {-1});
|
||||||
EXPECT_THROW(opset1::TopK(data, k_negative, 0, "max", "index"), ov::NodeValidationFailure);
|
EXPECT_THROW(op::v1::TopK(data, k_negative, 0, "max", "index"), ov::NodeValidationFailure);
|
||||||
}
|
}
|
||||||
|
|
||||||
class ReferenceTopKTestResnet50V3 : public ReferenceTopKTestResnet50 {
|
class ReferenceTopKTestResnet50V3 : public ReferenceTopKTestResnet50 {
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const TopKParamsResnet50& params) {
|
static std::shared_ptr<Model> CreateFunction(const TopKParamsResnet50& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto B = std::make_shared<opset3::TopK>(A,
|
const auto B = std::make_shared<op::v3::TopK>(A,
|
||||||
opset1::Constant::create(element::i64, {}, {5}),
|
op::v0::Constant::create(element::i64, {}, {5}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES);
|
op::v1::TopK::SortType::SORT_VALUES);
|
||||||
const auto C = std::make_shared<opset3::TopK>(A,
|
const auto C = std::make_shared<op::v3::TopK>(A,
|
||||||
opset1::Constant::create(element::i64, {}, {1}),
|
op::v0::Constant::create(element::i64, {}, {1}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES);
|
op::v1::TopK::SortType::SORT_VALUES);
|
||||||
|
|
||||||
const auto out5_value = B->output(0);
|
const auto out5_value = B->output(0);
|
||||||
const auto out5_index = B->output(1);
|
const auto out5_index = B->output(1);
|
||||||
@ -1371,9 +1372,9 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs,
|
|||||||
class ReferenceTopKTestMaxMinSortV3 : public ReferenceTopKTestMaxMinSort {
|
class ReferenceTopKTestMaxMinSortV3 : public ReferenceTopKTestMaxMinSort {
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const TopKParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const TopKParams& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
||||||
const auto B = std::make_shared<opset3::TopK>(A, k, params.axis, params.mode, params.sort);
|
const auto B = std::make_shared<op::v3::TopK>(A, k, params.axis, params.mode, params.sort);
|
||||||
const auto f = std::make_shared<Model>(B->outputs(), ParameterVector{A});
|
const auto f = std::make_shared<Model>(B->outputs(), ParameterVector{A});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -1391,9 +1392,9 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs,
|
|||||||
class ReferenceTopKTestBackendV3 : public ReferenceTopKTestBackend {
|
class ReferenceTopKTestBackendV3 : public ReferenceTopKTestBackend {
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const TopKParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const TopKParams& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
||||||
const auto B = std::make_shared<opset3::TopK>(A, k, params.axis, params.mode, params.sort);
|
const auto B = std::make_shared<op::v3::TopK>(A, k, params.axis, params.mode, params.sort);
|
||||||
const auto f = std::make_shared<Model>(B->outputs(), ParameterVector{A});
|
const auto f = std::make_shared<Model>(B->outputs(), ParameterVector{A});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -1411,9 +1412,9 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs,
|
|||||||
class ReferenceTopKTest1dMaxMinV3 : public ReferenceTopKTest1dMaxMin {
|
class ReferenceTopKTest1dMaxMinV3 : public ReferenceTopKTest1dMaxMin {
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const TopKParams& params, size_t out_idx) {
|
static std::shared_ptr<Model> CreateFunction(const TopKParams& params, size_t out_idx) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
||||||
const auto B = std::make_shared<opset3::TopK>(A, k, params.axis, params.mode, params.sort);
|
const auto B = std::make_shared<op::v3::TopK>(A, k, params.axis, params.mode, params.sort);
|
||||||
const auto f = std::make_shared<Model>(OutputVector{B->output(out_idx)}, ParameterVector{A});
|
const auto f = std::make_shared<Model>(OutputVector{B->output(out_idx)}, ParameterVector{A});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -1431,9 +1432,9 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs,
|
|||||||
class ReferenceTopKTestInt64V3 : public ReferenceTopKTestInt64 {
|
class ReferenceTopKTestInt64V3 : public ReferenceTopKTestInt64 {
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const TopKParams& params, size_t out_idx) {
|
static std::shared_ptr<Model> CreateFunction(const TopKParams& params, size_t out_idx) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
||||||
const auto B = std::make_shared<opset3::TopK>(A, k, params.axis, params.mode, params.sort, element::i64);
|
const auto B = std::make_shared<op::v3::TopK>(A, k, params.axis, params.mode, params.sort, element::i64);
|
||||||
const auto f = std::make_shared<Model>(OutputVector{B->output(out_idx)}, ParameterVector{A});
|
const auto f = std::make_shared<Model>(OutputVector{B->output(out_idx)}, ParameterVector{A});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -1451,9 +1452,9 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs,
|
|||||||
class ReferenceTopKTestSingleOutputV3 : public ReferenceTopKTestSingleOutput {
|
class ReferenceTopKTestSingleOutputV3 : public ReferenceTopKTestSingleOutput {
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const TopKParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const TopKParams& params) {
|
||||||
const auto A = std::make_shared<opset1::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto k = opset1::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
||||||
const auto B = std::make_shared<opset3::TopK>(A, k, params.axis, params.mode, params.sort);
|
const auto B = std::make_shared<op::v3::TopK>(A, k, params.axis, params.mode, params.sort);
|
||||||
const auto f = std::make_shared<Model>(OutputVector{B->output(1)}, ParameterVector{A});
|
const auto f = std::make_shared<Model>(OutputVector{B->output(1)}, ParameterVector{A});
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -1469,20 +1470,20 @@ INSTANTIATE_TEST_SUITE_P(smoke_TopK_With_Hardcoded_Refs,
|
|||||||
ReferenceTopKTestSingleOutputV3::getTestCaseName);
|
ReferenceTopKTestSingleOutputV3::getTestCaseName);
|
||||||
|
|
||||||
TEST(ReferenceTopKTestInvalidV3, topk_v3_invalid_strings) {
|
TEST(ReferenceTopKTestInvalidV3, topk_v3_invalid_strings) {
|
||||||
const auto data = std::make_shared<opset1::Parameter>(element::f32, Shape{1, 2, 3});
|
const auto data = std::make_shared<op::v0::Parameter>(element::f32, Shape{1, 2, 3});
|
||||||
const auto k = opset1::Constant::create(element::i64, Shape{}, {1});
|
const auto k = op::v0::Constant::create(element::i64, Shape{}, {1});
|
||||||
EXPECT_THROW(opset3::TopK(data, k, 0, "max", "invalid_mode"), ov::AssertFailure);
|
EXPECT_THROW(op::v3::TopK(data, k, 0, "max", "invalid_mode"), ov::AssertFailure);
|
||||||
EXPECT_THROW(opset3::TopK(data, k, 0, "invalid_sort", "index"), ov::AssertFailure);
|
EXPECT_THROW(op::v3::TopK(data, k, 0, "invalid_sort", "index"), ov::AssertFailure);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(ReferenceTopKTestInvalidV3, topk_v3_invalid_k) {
|
TEST(ReferenceTopKTestInvalidV3, topk_v3_invalid_k) {
|
||||||
const auto data = std::make_shared<opset1::Parameter>(element::f32, Shape{1, 2, 3});
|
const auto data = std::make_shared<op::v0::Parameter>(element::f32, Shape{1, 2, 3});
|
||||||
const auto k_non_scalar = opset1::Constant::create(element::i64, Shape{2}, {1, 2});
|
const auto k_non_scalar = op::v0::Constant::create(element::i64, Shape{2}, {1, 2});
|
||||||
EXPECT_THROW(opset3::TopK(data, k_non_scalar, 0, "max", "index"), ov::NodeValidationFailure);
|
EXPECT_THROW(op::v3::TopK(data, k_non_scalar, 0, "max", "index"), ov::NodeValidationFailure);
|
||||||
const auto k_float = opset1::Constant::create(element::f32, Shape{}, {1.0f});
|
const auto k_float = op::v0::Constant::create(element::f32, Shape{}, {1.0f});
|
||||||
EXPECT_THROW(opset3::TopK(data, k_float, 0, "max", "index"), ov::NodeValidationFailure);
|
EXPECT_THROW(op::v3::TopK(data, k_float, 0, "max", "index"), ov::NodeValidationFailure);
|
||||||
const auto k_negative = opset1::Constant::create(element::i8, Shape{}, {-1});
|
const auto k_negative = op::v0::Constant::create(element::i8, Shape{}, {-1});
|
||||||
EXPECT_THROW(opset3::TopK(data, k_negative, 0, "max", "index"), ov::NodeValidationFailure);
|
EXPECT_THROW(op::v3::TopK(data, k_negative, 0, "max", "index"), ov::NodeValidationFailure);
|
||||||
}
|
}
|
||||||
|
|
||||||
class ReferenceTopKv11StableTest : public ReferenceTopKTest {
|
class ReferenceTopKv11StableTest : public ReferenceTopKTest {
|
||||||
@ -1502,12 +1503,12 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::shared_ptr<Model> CreateFunction(const TopKParams& params) {
|
static std::shared_ptr<Model> CreateFunction(const TopKParams& params) {
|
||||||
const auto A = std::make_shared<opset11::Parameter>(params.A.type, params.A.shape);
|
const auto A = std::make_shared<op::v0::Parameter>(params.A.type, params.A.shape);
|
||||||
const auto k = opset11::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
const auto k = op::v0::Constant::create(params.k.type, params.k.shape, params.k.data.data());
|
||||||
const auto topk_stable =
|
const auto topk_stable =
|
||||||
std::make_shared<opset11::TopK>(A, k, params.axis, params.mode, params.sort, params.result1.type, true);
|
std::make_shared<op::v11::TopK>(A, k, params.axis, params.mode, params.sort, params.result1.type, true);
|
||||||
const auto topk_unstable =
|
const auto topk_unstable =
|
||||||
std::make_shared<opset11::TopK>(A, k, params.axis, params.mode, params.sort, params.result1.type, false);
|
std::make_shared<op::v11::TopK>(A, k, params.axis, params.mode, params.sort, params.result1.type, false);
|
||||||
|
|
||||||
return std::make_shared<Model>(
|
return std::make_shared<Model>(
|
||||||
OutputVector{topk_stable->output(0), topk_stable->output(1), topk_unstable->output(0)},
|
OutputVector{topk_stable->output(0), topk_stable->output(1), topk_unstable->output(0)},
|
||||||
@ -1528,8 +1529,8 @@ std::vector<TopKParams> generateParamsForStableTest() {
|
|||||||
TopKParams(reference_tests::Tensor(ET, {2, 7}, std::vector<T>{5, 4, 3, 1, 7, 1, 3, 2, 1, 2, 5, 1, 7, 3}),
|
TopKParams(reference_tests::Tensor(ET, {2, 7}, std::vector<T>{5, 4, 3, 1, 7, 1, 3, 2, 1, 2, 5, 1, 7, 3}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{3}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 3}, std::vector<T>{1, 1, 3, 1, 1, 2}),
|
reference_tests::Tensor(ET, {2, 3}, std::vector<T>{1, 1, 3, 1, 1, 2}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 3}, std::vector<T_OUT>{3, 5, 2, 1, 4, 0}),
|
reference_tests::Tensor(ET_OUT, {2, 3}, std::vector<T_OUT>{3, 5, 2, 1, 4, 0}),
|
||||||
0,
|
0,
|
||||||
@ -1541,8 +1542,8 @@ std::vector<TopKParams> generateParamsForStableTest() {
|
|||||||
}),
|
}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{4}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{4}),
|
||||||
0,
|
0,
|
||||||
opset1::TopK::Mode::MAX,
|
op::v1::TopK::Mode::MAX,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {4, 3}, std::vector<T>{8, 9, 5, 7, 8, 4, 7, 7, 3, 5, 7, 2}),
|
reference_tests::Tensor(ET, {4, 3}, std::vector<T>{8, 9, 5, 7, 8, 4, 7, 7, 3, 5, 7, 2}),
|
||||||
reference_tests::Tensor(ET_OUT, {4, 3}, std::vector<T_OUT>{5, 1, 4, 1, 3, 5, 4, 0, 6, 0, 2, 2}),
|
reference_tests::Tensor(ET_OUT, {4, 3}, std::vector<T_OUT>{5, 1, 4, 1, 3, 5, 4, 0, 6, 0, 2, 2}),
|
||||||
0,
|
0,
|
||||||
@ -1552,8 +1553,8 @@ std::vector<TopKParams> generateParamsForStableTest() {
|
|||||||
std::vector<T>{1, 3, 3, 1, 2, 4, 2, 2, 3, 7, 7, 1, 7, 9, 7, 5, 7, 7}),
|
std::vector<T>{1, 3, 3, 1, 2, 4, 2, 2, 3, 7, 7, 1, 7, 9, 7, 5, 7, 7}),
|
||||||
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
reference_tests::Tensor(ET2, {}, std::vector<T2>{2}),
|
||||||
1,
|
1,
|
||||||
opset1::TopK::Mode::MIN,
|
op::v1::TopK::Mode::MIN,
|
||||||
opset1::TopK::SortType::SORT_VALUES,
|
op::v1::TopK::SortType::SORT_VALUES,
|
||||||
reference_tests::Tensor(ET, {2, 2, 3}, std::vector<T>{1, 2, 3, 1, 2, 3, 5, 7, 1, 7, 7, 7}),
|
reference_tests::Tensor(ET, {2, 2, 3}, std::vector<T>{1, 2, 3, 1, 2, 3, 5, 7, 1, 7, 7, 7}),
|
||||||
reference_tests::Tensor(ET_OUT, {2, 2, 3}, std::vector<T_OUT>{0, 1, 0, 1, 2, 2, 2, 0, 0, 0, 2, 1}),
|
reference_tests::Tensor(ET_OUT, {2, 2, 3}, std::vector<T_OUT>{0, 1, 0, 1, 2, 2, 2, 0, 0, 0, 2, 1}),
|
||||||
0,
|
0,
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
// Copyright (C) 2018-2023 Intel Corporation
|
// Copyright (C) 2018-2023 Intel Corporation
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
#include <common_test_utils/test_constants.hpp>
|
|
||||||
|
|
||||||
#include "behavior/compiled_model/import_export.hpp"
|
#include "behavior/compiled_model/import_export.hpp"
|
||||||
|
#include "common_test_utils/test_constants.hpp"
|
||||||
#include "ie_plugin_config.hpp"
|
#include "ie_plugin_config.hpp"
|
||||||
|
|
||||||
using namespace ov::test::behavior;
|
using namespace ov::test::behavior;
|
||||||
|
@ -8,13 +8,13 @@
|
|||||||
# include <opencv2/imgproc/types_c.h>
|
# include <opencv2/imgproc/types_c.h>
|
||||||
|
|
||||||
# include <opencv2/imgproc.hpp>
|
# include <opencv2/imgproc.hpp>
|
||||||
# include <openvino/core/preprocess/pre_post_process.hpp>
|
|
||||||
# include <shared_test_classes/base/layer_test_utils.hpp>
|
|
||||||
# include <shared_test_classes/single_layer/convert_color_i420.hpp>
|
|
||||||
# include <shared_test_classes/single_layer/convert_color_nv12.hpp>
|
|
||||||
|
|
||||||
# include "base_reference_test.hpp"
|
# include "base_reference_test.hpp"
|
||||||
|
# include "openvino/core/preprocess/pre_post_process.hpp"
|
||||||
# include "ov_models/builders.hpp"
|
# include "ov_models/builders.hpp"
|
||||||
|
# include "shared_test_classes/base/layer_test_utils.hpp"
|
||||||
|
# include "shared_test_classes/single_layer/convert_color_i420.hpp"
|
||||||
|
# include "shared_test_classes/single_layer/convert_color_nv12.hpp"
|
||||||
|
|
||||||
using namespace ov;
|
using namespace ov;
|
||||||
using namespace ov::preprocess;
|
using namespace ov::preprocess;
|
||||||
|
@ -11,21 +11,24 @@
|
|||||||
#include "common_test_utils/graph_comparator.hpp"
|
#include "common_test_utils/graph_comparator.hpp"
|
||||||
#include "common_test_utils/ov_test_utils.hpp"
|
#include "common_test_utils/ov_test_utils.hpp"
|
||||||
#include "functional_test_utils/ov_plugin_cache.hpp"
|
#include "functional_test_utils/ov_plugin_cache.hpp"
|
||||||
#include "openvino/opsets/opset11.hpp"
|
#include "openvino/op/constant.hpp"
|
||||||
|
#include "openvino/op/convert.hpp"
|
||||||
|
#include "openvino/op/convert_like.hpp"
|
||||||
|
#include "openvino/op/parameter.hpp"
|
||||||
#include "template/properties.hpp"
|
#include "template/properties.hpp"
|
||||||
|
|
||||||
TEST(DisableTransformationsTests, TestTemplatePluginProperty) {
|
TEST(DisableTransformationsTests, TestTemplatePluginProperty) {
|
||||||
std::shared_ptr<ov::Model> m(nullptr), m_ref(nullptr);
|
std::shared_ptr<ov::Model> m(nullptr), m_ref(nullptr);
|
||||||
{
|
{
|
||||||
auto data = std::make_shared<ov::opset11::Parameter>(ov::element::f32, ov::Shape{3, 1, 2});
|
auto data = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{3, 1, 2});
|
||||||
auto like = ov::opset11::Constant::create(ov::element::i32, ov::Shape{1}, {1});
|
auto like = ov::op::v0::Constant::create(ov::element::i32, ov::Shape{1}, {1});
|
||||||
auto cvtlike = std::make_shared<ov::opset11::ConvertLike>(data, like);
|
auto cvtlike = std::make_shared<ov::op::v1::ConvertLike>(data, like);
|
||||||
|
|
||||||
m = std::make_shared<ov::Model>(ov::NodeVector{cvtlike}, ov::ParameterVector{data});
|
m = std::make_shared<ov::Model>(ov::NodeVector{cvtlike}, ov::ParameterVector{data});
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto data = std::make_shared<ov::opset11::Parameter>(ov::element::f32, ov::Shape{3, 1, 2});
|
auto data = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{3, 1, 2});
|
||||||
auto cvt = std::make_shared<ov::opset11::Convert>(data, ov::element::i32);
|
auto cvt = std::make_shared<ov::op::v0::Convert>(data, ov::element::i32);
|
||||||
|
|
||||||
m_ref = std::make_shared<ov::Model>(ov::NodeVector{cvt}, ov::ParameterVector{data});
|
m_ref = std::make_shared<ov::Model>(ov::NodeVector{cvt}, ov::ParameterVector{data});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user