Refactor InterpolateLayerTest, IsInfLayerTest, LogSoftmaxLayerTest, LogicalLayerTest (#20196)
* Refactor InterpolateLayerTest * Refactor IsInfLayerTest * Refactor LogSoftmaxLayerTest * Refactor LogicalLayerTest
This commit is contained in:
parent
3c01e71a76
commit
4c14ad365c
@ -4,190 +4,173 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "single_layer_tests/interpolate.hpp"
|
||||
#include "single_op_tests/interpolate.hpp"
|
||||
#include "common_test_utils/test_constants.hpp"
|
||||
|
||||
using namespace LayerTestsDefinitions;
|
||||
|
||||
namespace {
|
||||
using ov::test::InterpolateLayerTest;
|
||||
|
||||
const std::vector<InferenceEngine::Precision> netPrecisions = {
|
||||
InferenceEngine::Precision::FP16,
|
||||
InferenceEngine::Precision::FP32,
|
||||
const std::vector<ov::element::Type> model_types = {
|
||||
ov::element::f16,
|
||||
ov::element::f32,
|
||||
};
|
||||
|
||||
const std::vector<std::vector<size_t>> inShapes = {
|
||||
{1, 4, 6, 6},
|
||||
const std::vector<ov::Shape> input_shapes_static = {
|
||||
{1, 4, 6, 6}
|
||||
};
|
||||
|
||||
const std::vector<ngraph::op::v4::Interpolate::InterpolateMode> modesWithoutNearest = {
|
||||
ngraph::op::v4::Interpolate::InterpolateMode::LINEAR,
|
||||
ngraph::op::v4::Interpolate::InterpolateMode::LINEAR_ONNX,
|
||||
ngraph::op::v4::Interpolate::InterpolateMode::CUBIC,
|
||||
const std::vector<ov::op::v4::Interpolate::InterpolateMode> modes_without_nearest = {
|
||||
ov::op::v4::Interpolate::InterpolateMode::LINEAR,
|
||||
ov::op::v4::Interpolate::InterpolateMode::LINEAR_ONNX,
|
||||
ov::op::v4::Interpolate::InterpolateMode::CUBIC,
|
||||
};
|
||||
|
||||
const std::vector<ngraph::op::v4::Interpolate::InterpolateMode> nearestMode = {
|
||||
ngraph::op::v4::Interpolate::InterpolateMode::NEAREST,
|
||||
const std::vector<ov::op::v4::Interpolate::InterpolateMode> nearest_mode = {
|
||||
ov::op::v4::Interpolate::InterpolateMode::NEAREST,
|
||||
};
|
||||
|
||||
const std::vector<ngraph::op::v4::Interpolate::CoordinateTransformMode> coordinateTransformModes = {
|
||||
ngraph::op::v4::Interpolate::CoordinateTransformMode::TF_HALF_PIXEL_FOR_NN,
|
||||
ngraph::op::v4::Interpolate::CoordinateTransformMode::PYTORCH_HALF_PIXEL,
|
||||
ngraph::op::v4::Interpolate::CoordinateTransformMode::HALF_PIXEL,
|
||||
ngraph::op::v4::Interpolate::CoordinateTransformMode::ASYMMETRIC,
|
||||
ngraph::op::v4::Interpolate::CoordinateTransformMode::ALIGN_CORNERS,
|
||||
const std::vector<ov::op::v4::Interpolate::CoordinateTransformMode> coordinateTransformModes = {
|
||||
ov::op::v4::Interpolate::CoordinateTransformMode::TF_HALF_PIXEL_FOR_NN,
|
||||
ov::op::v4::Interpolate::CoordinateTransformMode::PYTORCH_HALF_PIXEL,
|
||||
ov::op::v4::Interpolate::CoordinateTransformMode::HALF_PIXEL,
|
||||
ov::op::v4::Interpolate::CoordinateTransformMode::ASYMMETRIC,
|
||||
ov::op::v4::Interpolate::CoordinateTransformMode::ALIGN_CORNERS,
|
||||
};
|
||||
|
||||
const std::vector<ngraph::op::v4::Interpolate::ShapeCalcMode> shapeCalculationMode = {
|
||||
ngraph::op::v4::Interpolate::ShapeCalcMode::SIZES,
|
||||
ngraph::op::v4::Interpolate::ShapeCalcMode::SCALES,
|
||||
const std::vector<ov::op::v4::Interpolate::ShapeCalcMode> shapeCalculationMode = {
|
||||
ov::op::v4::Interpolate::ShapeCalcMode::SIZES,
|
||||
ov::op::v4::Interpolate::ShapeCalcMode::SCALES,
|
||||
};
|
||||
|
||||
const std::vector<ngraph::op::v4::Interpolate::NearestMode> nearestModes = {
|
||||
ngraph::op::v4::Interpolate::NearestMode::SIMPLE,
|
||||
ngraph::op::v4::Interpolate::NearestMode::ROUND_PREFER_FLOOR,
|
||||
ngraph::op::v4::Interpolate::NearestMode::FLOOR,
|
||||
ngraph::op::v4::Interpolate::NearestMode::CEIL,
|
||||
ngraph::op::v4::Interpolate::NearestMode::ROUND_PREFER_CEIL,
|
||||
const std::vector<ov::op::v4::Interpolate::NearestMode> nearest_modes = {
|
||||
ov::op::v4::Interpolate::NearestMode::SIMPLE,
|
||||
ov::op::v4::Interpolate::NearestMode::ROUND_PREFER_FLOOR,
|
||||
ov::op::v4::Interpolate::NearestMode::FLOOR,
|
||||
ov::op::v4::Interpolate::NearestMode::CEIL,
|
||||
ov::op::v4::Interpolate::NearestMode::ROUND_PREFER_CEIL,
|
||||
};
|
||||
|
||||
const std::vector<ngraph::op::v4::Interpolate::NearestMode> defaultNearestMode = {
|
||||
ngraph::op::v4::Interpolate::NearestMode::ROUND_PREFER_FLOOR,
|
||||
const std::vector<ov::op::v4::Interpolate::NearestMode> default_nearest_mode = {
|
||||
ov::op::v4::Interpolate::NearestMode::ROUND_PREFER_FLOOR,
|
||||
};
|
||||
|
||||
const std::vector<std::vector<size_t>> pads = {
|
||||
{0, 0, 1, 1},
|
||||
{0, 0, 0, 0},
|
||||
{0, 0, 1, 1},
|
||||
{0, 0, 0, 0},
|
||||
};
|
||||
|
||||
const std::vector<bool> antialias = {
|
||||
// Not enabled in Inference Engine
|
||||
// true,
|
||||
false,
|
||||
false,
|
||||
};
|
||||
|
||||
const std::vector<double> cubeCoefs = {
|
||||
-0.75f,
|
||||
const std::vector<double> cube_coefs = {
|
||||
-0.75f,
|
||||
};
|
||||
|
||||
const std::vector<std::vector<int64_t>> defaultAxes = {
|
||||
const std::vector<std::vector<int64_t>> default_axes = {
|
||||
{0, 1, 2, 3}
|
||||
};
|
||||
|
||||
const std::vector<std::vector<size_t>> targetShapes = {
|
||||
const std::vector<ov::Shape> target_shapes = {
|
||||
{1, 4, 8, 8},
|
||||
};
|
||||
|
||||
const std::vector<std::vector<float>> defaultScales = {
|
||||
const std::vector<std::vector<float>> default_scales = {
|
||||
{1.f, 1.f, 1.333333f, 1.333333f}
|
||||
};
|
||||
|
||||
std::map<std::string, std::string> additional_config = {};
|
||||
|
||||
const auto interpolateCasesWithoutNearest = ::testing::Combine(
|
||||
::testing::ValuesIn(modesWithoutNearest),
|
||||
::testing::ValuesIn(modes_without_nearest),
|
||||
::testing::ValuesIn(shapeCalculationMode),
|
||||
::testing::ValuesIn(coordinateTransformModes),
|
||||
::testing::ValuesIn(defaultNearestMode),
|
||||
::testing::ValuesIn(default_nearest_mode),
|
||||
::testing::ValuesIn(antialias),
|
||||
::testing::ValuesIn(pads),
|
||||
::testing::ValuesIn(pads),
|
||||
::testing::ValuesIn(cubeCoefs),
|
||||
::testing::ValuesIn(defaultAxes),
|
||||
::testing::ValuesIn(defaultScales));
|
||||
::testing::ValuesIn(cube_coefs),
|
||||
::testing::ValuesIn(default_axes),
|
||||
::testing::ValuesIn(default_scales));
|
||||
|
||||
const auto interpolateCases = ::testing::Combine(
|
||||
::testing::ValuesIn(nearestMode),
|
||||
::testing::ValuesIn(nearest_mode),
|
||||
::testing::ValuesIn(shapeCalculationMode),
|
||||
::testing::ValuesIn(coordinateTransformModes),
|
||||
::testing::ValuesIn(nearestModes),
|
||||
::testing::ValuesIn(nearest_modes),
|
||||
::testing::ValuesIn(antialias),
|
||||
::testing::ValuesIn(pads),
|
||||
::testing::ValuesIn(pads),
|
||||
::testing::ValuesIn(cubeCoefs),
|
||||
::testing::ValuesIn(defaultAxes),
|
||||
::testing::ValuesIn(defaultScales));
|
||||
::testing::ValuesIn(cube_coefs),
|
||||
::testing::ValuesIn(default_axes),
|
||||
::testing::ValuesIn(default_scales));
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_Interpolate_Basic, InterpolateLayerTest, ::testing::Combine(
|
||||
interpolateCasesWithoutNearest,
|
||||
::testing::ValuesIn(netPrecisions),
|
||||
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
::testing::Values(InferenceEngine::Layout::ANY),
|
||||
::testing::Values(InferenceEngine::Layout::ANY),
|
||||
::testing::ValuesIn(inShapes),
|
||||
::testing::ValuesIn(targetShapes),
|
||||
::testing::ValuesIn(model_types),
|
||||
::testing::Values(ov::test::static_shapes_to_test_representation(input_shapes_static)),
|
||||
::testing::ValuesIn(target_shapes),
|
||||
::testing::Values(ov::test::utils::DEVICE_CPU),
|
||||
::testing::Values(additional_config)),
|
||||
InterpolateLayerTest::getTestCaseName);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_Interpolate_Nearest, InterpolateLayerTest, ::testing::Combine(
|
||||
interpolateCases,
|
||||
::testing::ValuesIn(netPrecisions),
|
||||
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
::testing::Values(InferenceEngine::Layout::ANY),
|
||||
::testing::Values(InferenceEngine::Layout::ANY),
|
||||
::testing::ValuesIn(inShapes),
|
||||
::testing::ValuesIn(targetShapes),
|
||||
::testing::ValuesIn(model_types),
|
||||
::testing::Values(ov::test::static_shapes_to_test_representation(input_shapes_static)),
|
||||
::testing::ValuesIn(target_shapes),
|
||||
::testing::Values(ov::test::utils::DEVICE_CPU),
|
||||
::testing::Values(additional_config)),
|
||||
InterpolateLayerTest::getTestCaseName);
|
||||
|
||||
const std::vector<std::vector<size_t>> targetShapesTailTest = {
|
||||
{1, 4, 2, 11}, // cover down sample and tails process code path
|
||||
const std::vector<ov::Shape> target_shapes_tail_test = {
|
||||
{1, 4, 2, 11}, // cover down sample and tails process code path
|
||||
};
|
||||
|
||||
const std::vector<std::vector<float>> defaultScalesTailTest = {
|
||||
const std::vector<std::vector<float>> default_scalesTailTest = {
|
||||
{1.f, 1.f, 0.333333f, 1.833333f}
|
||||
};
|
||||
|
||||
const auto interpolateCasesWithoutNearestTail = ::testing::Combine(
|
||||
::testing::ValuesIn(modesWithoutNearest),
|
||||
::testing::ValuesIn(modes_without_nearest),
|
||||
::testing::ValuesIn(shapeCalculationMode),
|
||||
::testing::ValuesIn(coordinateTransformModes),
|
||||
::testing::ValuesIn(defaultNearestMode),
|
||||
::testing::ValuesIn(default_nearest_mode),
|
||||
::testing::ValuesIn(antialias),
|
||||
::testing::ValuesIn(pads),
|
||||
::testing::ValuesIn(pads),
|
||||
::testing::ValuesIn(cubeCoefs),
|
||||
::testing::ValuesIn(defaultAxes),
|
||||
::testing::ValuesIn(defaultScalesTailTest));
|
||||
::testing::ValuesIn(cube_coefs),
|
||||
::testing::ValuesIn(default_axes),
|
||||
::testing::ValuesIn(default_scalesTailTest));
|
||||
|
||||
const auto interpolateCasesTail = ::testing::Combine(
|
||||
::testing::ValuesIn(nearestMode),
|
||||
::testing::ValuesIn(nearest_mode),
|
||||
::testing::ValuesIn(shapeCalculationMode),
|
||||
::testing::ValuesIn(coordinateTransformModes),
|
||||
::testing::ValuesIn(nearestModes),
|
||||
::testing::ValuesIn(nearest_modes),
|
||||
::testing::ValuesIn(antialias),
|
||||
::testing::ValuesIn(pads),
|
||||
::testing::ValuesIn(pads),
|
||||
::testing::ValuesIn(cubeCoefs),
|
||||
::testing::ValuesIn(defaultAxes),
|
||||
::testing::ValuesIn(defaultScalesTailTest));
|
||||
::testing::ValuesIn(cube_coefs),
|
||||
::testing::ValuesIn(default_axes),
|
||||
::testing::ValuesIn(default_scalesTailTest));
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_Interpolate_Basic_Down_Sample_Tail, InterpolateLayerTest, ::testing::Combine(
|
||||
interpolateCasesWithoutNearestTail,
|
||||
::testing::ValuesIn(netPrecisions),
|
||||
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
::testing::Values(InferenceEngine::Layout::ANY),
|
||||
::testing::Values(InferenceEngine::Layout::ANY),
|
||||
::testing::ValuesIn(inShapes),
|
||||
::testing::ValuesIn(targetShapesTailTest),
|
||||
::testing::ValuesIn(model_types),
|
||||
::testing::Values(ov::test::static_shapes_to_test_representation(input_shapes_static)),
|
||||
::testing::ValuesIn(target_shapes_tail_test),
|
||||
::testing::Values(ov::test::utils::DEVICE_CPU),
|
||||
::testing::Values(additional_config)),
|
||||
InterpolateLayerTest::getTestCaseName);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_Interpolate_Nearest_Down_Sample_Tail, InterpolateLayerTest, ::testing::Combine(
|
||||
interpolateCasesTail,
|
||||
::testing::ValuesIn(netPrecisions),
|
||||
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
::testing::Values(InferenceEngine::Layout::ANY),
|
||||
::testing::Values(InferenceEngine::Layout::ANY),
|
||||
::testing::ValuesIn(inShapes),
|
||||
::testing::ValuesIn(targetShapesTailTest),
|
||||
::testing::ValuesIn(model_types),
|
||||
::testing::Values(ov::test::static_shapes_to_test_representation(input_shapes_static)),
|
||||
::testing::ValuesIn(target_shapes_tail_test),
|
||||
::testing::Values(ov::test::utils::DEVICE_CPU),
|
||||
::testing::Values(additional_config)),
|
||||
InterpolateLayerTest::getTestCaseName);
|
||||
|
@ -2,14 +2,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include <vector>
|
||||
#include "shared_test_classes/single_layer/is_inf.hpp"
|
||||
|
||||
using namespace ov::test;
|
||||
using namespace ov::test::subgraph;
|
||||
#include "single_op_tests/is_inf.hpp"
|
||||
|
||||
namespace {
|
||||
std::vector<std::vector<InputShape>> inShapesStatic = {
|
||||
using ov::test::IsInfLayerTest;
|
||||
|
||||
std::vector<std::vector<ov::test::InputShape>> input_shapes_static = {
|
||||
{ {{}, {{2}}} },
|
||||
{ {{}, {{2, 200}}} },
|
||||
{ {{}, {{10, 200}}} },
|
||||
@ -29,45 +27,40 @@ std::vector<std::vector<InputShape>> inShapesStatic = {
|
||||
{ {{}, {{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}} }
|
||||
};
|
||||
|
||||
std::vector<std::vector<InputShape>> inShapesDynamic = {
|
||||
std::vector<std::vector<ov::test::InputShape>> input_shapes_dynamic = {
|
||||
{{{ngraph::Dimension(1, 10), 200}, {{2, 200}, {1, 200}}}}
|
||||
};
|
||||
|
||||
std::vector<ElementType> netPrecisions = {
|
||||
std::vector<ov::element::Type> model_types = {
|
||||
ov::element::f32
|
||||
};
|
||||
|
||||
std::vector<bool> detectNegative = {
|
||||
std::vector<bool> detect_negative = {
|
||||
true, false
|
||||
};
|
||||
|
||||
std::vector<bool> detectPositive = {
|
||||
std::vector<bool> detect_positive = {
|
||||
true, false
|
||||
};
|
||||
|
||||
std::map<std::string, std::string> additional_config = {};
|
||||
|
||||
const auto isInfParams = ::testing::Combine(
|
||||
::testing::ValuesIn(inShapesStatic),
|
||||
::testing::ValuesIn(detectNegative),
|
||||
::testing::ValuesIn(detectPositive),
|
||||
::testing::ValuesIn(netPrecisions),
|
||||
const auto is_inf_params = ::testing::Combine(
|
||||
::testing::ValuesIn(input_shapes_static),
|
||||
::testing::ValuesIn(detect_negative),
|
||||
::testing::ValuesIn(detect_positive),
|
||||
::testing::ValuesIn(model_types),
|
||||
::testing::Values(ov::test::utils::DEVICE_CPU),
|
||||
::testing::Values(additional_config));
|
||||
|
||||
const auto isInfParamsDyn = ::testing::Combine(
|
||||
::testing::ValuesIn(inShapesDynamic),
|
||||
::testing::ValuesIn(detectNegative),
|
||||
::testing::ValuesIn(detectPositive),
|
||||
::testing::ValuesIn(netPrecisions),
|
||||
const auto is_inf_params_dynamic = ::testing::Combine(
|
||||
::testing::ValuesIn(input_shapes_dynamic),
|
||||
::testing::ValuesIn(detect_negative),
|
||||
::testing::ValuesIn(detect_positive),
|
||||
::testing::ValuesIn(model_types),
|
||||
::testing::Values(ov::test::utils::DEVICE_CPU),
|
||||
::testing::Values(additional_config));
|
||||
|
||||
|
||||
TEST_P(IsInfLayerTest, CompareWithRefs) {
|
||||
run();
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_static, IsInfLayerTest, isInfParams, IsInfLayerTest::getTestCaseName);
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_dynamic, IsInfLayerTest, isInfParamsDyn, IsInfLayerTest::getTestCaseName);
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_static, IsInfLayerTest, is_inf_params, IsInfLayerTest::getTestCaseName);
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_dynamic, IsInfLayerTest, is_inf_params_dynamic, IsInfLayerTest::getTestCaseName);
|
||||
} // namespace
|
||||
|
@ -4,72 +4,61 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "single_layer_tests/log_softmax.hpp"
|
||||
#include "single_op_tests/log_softmax.hpp"
|
||||
#include "common_test_utils/test_constants.hpp"
|
||||
|
||||
using namespace LayerTestsDefinitions;
|
||||
|
||||
namespace {
|
||||
using ov::test::LogSoftmaxLayerTest;
|
||||
|
||||
const std::vector<InferenceEngine::Precision> netPrecisions = {
|
||||
InferenceEngine::Precision::FP32,
|
||||
const std::vector<ov::element::Type> model_types = {
|
||||
ov::element::f32,
|
||||
};
|
||||
|
||||
const std::vector<InferenceEngine::SizeVector> inputShapes2D = {
|
||||
InferenceEngine::SizeVector {1, 100},
|
||||
InferenceEngine::SizeVector {100, 1},
|
||||
InferenceEngine::SizeVector {10, 10},
|
||||
const std::vector<std::vector<ov::Shape>> input_shapes_2d = {
|
||||
{{1, 100}},
|
||||
{{100, 1}},
|
||||
{{10, 10}},
|
||||
};
|
||||
|
||||
const std::vector<int64_t> axis2D = {
|
||||
const std::vector<int64_t> axis_2d = {
|
||||
-2, -1, 0, 1
|
||||
};
|
||||
|
||||
const auto params2D = testing::Combine(
|
||||
testing::ValuesIn(netPrecisions),
|
||||
testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
testing::Values(InferenceEngine::Layout::ANY),
|
||||
testing::Values(InferenceEngine::Layout::ANY),
|
||||
testing::ValuesIn(inputShapes2D),
|
||||
testing::ValuesIn(axis2D),
|
||||
testing::Values(ov::test::utils::DEVICE_CPU),
|
||||
testing::Values(std::map<std::string, std::string>())
|
||||
const auto params_2d = testing::Combine(
|
||||
testing::ValuesIn(model_types),
|
||||
testing::ValuesIn(ov::test::static_shapes_to_test_representation(input_shapes_2d)),
|
||||
testing::ValuesIn(axis_2d),
|
||||
testing::Values(ov::test::utils::DEVICE_CPU)
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
smoke_LogSoftmax2D,
|
||||
LogSoftmaxLayerTest,
|
||||
params2D,
|
||||
params_2d,
|
||||
LogSoftmaxLayerTest::getTestCaseName
|
||||
);
|
||||
|
||||
const std::vector<InferenceEngine::SizeVector> inputShapes4D = {
|
||||
InferenceEngine::SizeVector {1, 100, 1, 1},
|
||||
InferenceEngine::SizeVector {1, 3, 4, 3},
|
||||
InferenceEngine::SizeVector {2, 3, 4, 5},
|
||||
const std::vector<std::vector<ov::Shape>> input_shapes_4d = {
|
||||
{{1, 100, 1, 1}},
|
||||
{{1, 3, 4, 3}},
|
||||
{{2, 3, 4, 5}},
|
||||
};
|
||||
|
||||
const std::vector<int64_t> axis4D = {
|
||||
const std::vector<int64_t> axis_4d = {
|
||||
-4, -3, -2, -1, 0, 1, 2, 3
|
||||
};
|
||||
|
||||
const auto params4D = testing::Combine(
|
||||
testing::ValuesIn(netPrecisions),
|
||||
testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
testing::Values(InferenceEngine::Layout::ANY),
|
||||
testing::Values(InferenceEngine::Layout::ANY),
|
||||
testing::ValuesIn(inputShapes4D),
|
||||
testing::ValuesIn(axis4D),
|
||||
testing::Values(ov::test::utils::DEVICE_CPU),
|
||||
testing::Values(std::map<std::string, std::string>())
|
||||
const auto params_4d = testing::Combine(
|
||||
testing::ValuesIn(model_types),
|
||||
testing::ValuesIn(ov::test::static_shapes_to_test_representation(input_shapes_4d)),
|
||||
testing::ValuesIn(axis_4d),
|
||||
testing::Values(ov::test::utils::DEVICE_CPU)
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
smoke_LogSoftmax4D,
|
||||
LogSoftmaxLayerTest,
|
||||
params4D,
|
||||
params_4d,
|
||||
LogSoftmaxLayerTest::getTestCaseName
|
||||
);
|
||||
|
||||
|
@ -2,16 +2,13 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include <vector>
|
||||
#include "single_layer_tests/logical.hpp"
|
||||
#include "single_op_tests/logical.hpp"
|
||||
#include "common_test_utils/test_constants.hpp"
|
||||
|
||||
using namespace LayerTestsDefinitions;
|
||||
using namespace LayerTestsDefinitions::LogicalParams;
|
||||
|
||||
namespace {
|
||||
using ov::test::LogicalLayerTest;
|
||||
|
||||
std::map<std::vector<size_t>, std::vector<std::vector<size_t >>> inputShapes = {
|
||||
std::map<ov::Shape, std::vector<ov::Shape>> input_shapes_static = {
|
||||
{{1}, {{1}, {17}, {1, 1}, {2, 18}, {1, 1, 2}, {2, 2, 3}, {1, 1, 2, 3}}},
|
||||
{{5}, {{1}, {1, 1}, {2, 5}, {1, 1, 1}, {2, 2, 5}}},
|
||||
{{2, 200}, {{1}, {200}, {1, 200}, {2, 200}, {2, 2, 200}}},
|
||||
@ -20,7 +17,7 @@ std::map<std::vector<size_t>, std::vector<std::vector<size_t >>> inputShapes = {
|
||||
{{2, 1, 1, 3, 1}, {{1}, {1, 3, 4}, {2, 1, 3, 4}, {1, 1, 1, 1, 1}}},
|
||||
};
|
||||
|
||||
std::map<std::vector<size_t>, std::vector<std::vector<size_t >>> inputShapesNot = {
|
||||
std::map<ov::Shape, std::vector<ov::Shape>> input_shapes_not_static = {
|
||||
{{1}, {}},
|
||||
{{5}, {}},
|
||||
{{2, 200}, {}},
|
||||
@ -29,53 +26,53 @@ std::map<std::vector<size_t>, std::vector<std::vector<size_t >>> inputShapesNot
|
||||
{{2, 1, 1, 3, 1}, {}},
|
||||
};
|
||||
|
||||
std::vector<InferenceEngine::Precision> inputsPrecisions = {
|
||||
InferenceEngine::Precision::BOOL,
|
||||
std::vector<std::vector<ov::Shape>> combine_shapes(const std::map<ov::Shape, std::vector<ov::Shape>>& input_shapes_static) {
|
||||
std::vector<std::vector<ov::Shape>> result;
|
||||
for (const auto& input_shape : input_shapes_static) {
|
||||
for (auto& item : input_shape.second) {
|
||||
result.push_back({input_shape.first, item});
|
||||
}
|
||||
|
||||
if (input_shape.second.empty()) {
|
||||
result.push_back({input_shape.first, {}});
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<ov::element::Type> model_types = {
|
||||
ov::element::boolean,
|
||||
};
|
||||
|
||||
std::vector<ngraph::helpers::LogicalTypes> logicalOpTypes = {
|
||||
ngraph::helpers::LogicalTypes::LOGICAL_AND,
|
||||
ngraph::helpers::LogicalTypes::LOGICAL_OR,
|
||||
ngraph::helpers::LogicalTypes::LOGICAL_XOR,
|
||||
std::vector<ov::test::utils::LogicalTypes> logicalOpTypes = {
|
||||
ov::test::utils::LogicalTypes::LOGICAL_AND,
|
||||
ov::test::utils::LogicalTypes::LOGICAL_OR,
|
||||
ov::test::utils::LogicalTypes::LOGICAL_XOR,
|
||||
};
|
||||
|
||||
std::vector<ngraph::helpers::InputLayerType> secondInputTypes = {
|
||||
ngraph::helpers::InputLayerType::CONSTANT,
|
||||
ngraph::helpers::InputLayerType::PARAMETER,
|
||||
};
|
||||
|
||||
std::vector<InferenceEngine::Precision> netPrecisions = {
|
||||
InferenceEngine::Precision::FP32,
|
||||
std::vector<ov::test::utils::InputLayerType> secondInputTypes = {
|
||||
ov::test::utils::InputLayerType::CONSTANT,
|
||||
ov::test::utils::InputLayerType::PARAMETER,
|
||||
};
|
||||
|
||||
std::map<std::string, std::string> additional_config = {};
|
||||
|
||||
const auto LogicalTestParams = ::testing::Combine(
|
||||
::testing::ValuesIn(LogicalLayerTest::combineShapes(inputShapes)),
|
||||
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(combine_shapes(input_shapes_static))),
|
||||
::testing::ValuesIn(logicalOpTypes),
|
||||
::testing::ValuesIn(secondInputTypes),
|
||||
::testing::ValuesIn(netPrecisions),
|
||||
::testing::ValuesIn(inputsPrecisions),
|
||||
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
::testing::Values(InferenceEngine::Layout::ANY),
|
||||
::testing::Values(InferenceEngine::Layout::ANY),
|
||||
::testing::ValuesIn(model_types),
|
||||
::testing::Values(ov::test::utils::DEVICE_CPU),
|
||||
::testing::Values(additional_config));
|
||||
|
||||
const auto LogicalTestParamsNot = ::testing::Combine(
|
||||
::testing::ValuesIn(LogicalLayerTest::combineShapes(inputShapesNot)),
|
||||
::testing::Values(ngraph::helpers::LogicalTypes::LOGICAL_NOT),
|
||||
::testing::Values(ngraph::helpers::InputLayerType::CONSTANT),
|
||||
::testing::ValuesIn(netPrecisions),
|
||||
::testing::ValuesIn(inputsPrecisions),
|
||||
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
|
||||
::testing::Values(InferenceEngine::Layout::ANY),
|
||||
::testing::Values(InferenceEngine::Layout::ANY),
|
||||
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(combine_shapes(input_shapes_not_static))),
|
||||
::testing::Values(ov::test::utils::LogicalTypes::LOGICAL_NOT),
|
||||
::testing::Values(ov::test::utils::InputLayerType::CONSTANT),
|
||||
::testing::ValuesIn(model_types),
|
||||
::testing::Values(ov::test::utils::DEVICE_CPU),
|
||||
::testing::Values(additional_config));
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs, LogicalLayerTest, LogicalTestParams, LogicalLayerTest::getTestCaseName);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefsNot, LogicalLayerTest, LogicalTestParamsNot, LogicalLayerTest::getTestCaseName);
|
||||
|
||||
} // namespace
|
||||
|
@ -189,6 +189,8 @@ std::vector<std::string> disabledTestPatterns() {
|
||||
// Issue: 121313
|
||||
R"(smoke_GroupConvBackpropData.*paddingDefined/GroupConvBackpropLayerTest.Inference.*f16.*)",
|
||||
R"(smoke_GroupConvBackpropData.*paddingDefined/GroupConvBackpropLayerTest.Inference.*f32.*)",
|
||||
// Issue: 122094
|
||||
R"(smoke_Interpolate_Basic_Down_Sample_Tail/InterpolateLayerTest.Inference.*(asymmetric|align_corners).*f16.*)",
|
||||
};
|
||||
#if defined(__APPLE__) && defined(OPENVINO_ARCH_ARM64)
|
||||
// Issue: 120950
|
||||
|
@ -0,0 +1,18 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared_test_classes/single_op/interpolate.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
TEST_P(InterpolateLayerTest, Inference) {
|
||||
run();
|
||||
}
|
||||
TEST_P(Interpolate11LayerTest, Inference) {
|
||||
run();
|
||||
}
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared_test_classes/single_op/is_inf.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
TEST_P(IsInfLayerTest, Inference) {
|
||||
run();
|
||||
}
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared_test_classes/single_op/log_softmax.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
TEST_P(LogSoftmaxLayerTest, Inference) {
|
||||
run();
|
||||
}
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared_test_classes/single_op/logical.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
TEST_P(LogicalLayerTest, Inference) {
|
||||
run();
|
||||
}
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -22,6 +22,10 @@
|
||||
|
||||
#include "openvino/op/dft.hpp"
|
||||
#include "openvino/op/idft.hpp"
|
||||
#include "openvino/op/logical_and.hpp"
|
||||
#include "openvino/op/logical_or.hpp"
|
||||
#include "openvino/op/logical_xor.hpp"
|
||||
#include "openvino/op/logical_not.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
@ -86,7 +90,10 @@ static std::map<ov::NodeTypeInfo, std::vector<std::vector<InputGenerateData>>> i
|
||||
{ ov::op::v4::ReduceL1::get_type_info_static(), {{{0, 5}}, {{0, 5, 1000}}} },
|
||||
{ ov::op::v4::ReduceL2::get_type_info_static(), {{{0, 5}}, {{0, 5, 1000}}} },
|
||||
{ ov::op::v7::DFT::get_type_info_static(), {{{0, 1}}, {{0, 1, 1000000}}} },
|
||||
{ ov::op::v7::IDFT::get_type_info_static(), {{{0, 1}}, {{0, 1, 1000000}}} },
|
||||
{ ov::op::v1::LogicalAnd::get_type_info_static(), {{{0, 2}}, {{0, 2, 1}}} },
|
||||
{ ov::op::v1::LogicalOr::get_type_info_static(), {{{0, 2}}, {{0, 2, 1}}} },
|
||||
{ ov::op::v1::LogicalNot::get_type_info_static(), {{{0, 2}}, {{0, 2, 1}}} },
|
||||
{ ov::op::v1::LogicalXor::get_type_info_static(), {{{0, 2}}, {{0, 2, 1}}} },
|
||||
};
|
||||
|
||||
} // namespace utils
|
||||
|
@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "shared_test_classes/base/ov_subgraph.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
typedef std::tuple<
|
||||
ov::op::util::InterpolateBase::InterpolateMode, // InterpolateMode
|
||||
ov::op::util::InterpolateBase::ShapeCalcMode, // ShapeCalculationMode
|
||||
ov::op::util::InterpolateBase::CoordinateTransformMode, // CoordinateTransformMode
|
||||
ov::op::util::InterpolateBase::NearestMode, // NearestMode
|
||||
bool, // AntiAlias
|
||||
std::vector<size_t>, // PadBegin
|
||||
std::vector<size_t>, // PadEnd
|
||||
double, // Cube coef
|
||||
std::vector<int64_t>, // Axes
|
||||
std::vector<float> // Scales
|
||||
> InterpolateSpecificParams;
|
||||
|
||||
typedef std::tuple<
|
||||
InterpolateSpecificParams,
|
||||
ov::element::Type, // Model type
|
||||
std::vector<InputShape>, // Input shapes
|
||||
ov::Shape, // Target shapes
|
||||
std::string, // Device name
|
||||
std::map<std::string, std::string> // Additional network configuration
|
||||
> InterpolateLayerTestParams;
|
||||
|
||||
class InterpolateLayerTest : public testing::WithParamInterface<InterpolateLayerTestParams>,
|
||||
virtual public ov::test::SubgraphBaseTest {
|
||||
public:
|
||||
static std::string getTestCaseName(const testing::TestParamInfo<InterpolateLayerTestParams>& obj);
|
||||
|
||||
protected:
|
||||
void SetUp() override;
|
||||
};
|
||||
|
||||
class Interpolate11LayerTest : public testing::WithParamInterface<InterpolateLayerTestParams>,
|
||||
virtual public ov::test::SubgraphBaseTest {
|
||||
public:
|
||||
static std::string getTestCaseName(const testing::TestParamInfo<InterpolateLayerTestParams>& obj);
|
||||
|
||||
protected:
|
||||
void SetUp() override;
|
||||
};
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -0,0 +1,31 @@
|
||||
// Copyright (C) 2022 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
#include "shared_test_classes/base/ov_subgraph.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
using IsInfParams = std::tuple<
|
||||
std::vector<InputShape>, // Data shape
|
||||
bool, // Detect negative
|
||||
bool, // Detect positive
|
||||
ov::element::Type, // Model type
|
||||
std::string, // Device name
|
||||
std::map<std::string, std::string> // Additional config
|
||||
>;
|
||||
|
||||
class IsInfLayerTest : public testing::WithParamInterface<IsInfParams>,
|
||||
virtual public SubgraphBaseTest {
|
||||
public:
|
||||
static std::string getTestCaseName(const testing::TestParamInfo<IsInfParams>& obj);
|
||||
protected:
|
||||
void SetUp() override;
|
||||
};
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -0,0 +1,32 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
#include "shared_test_classes/base/ov_subgraph.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
using logSoftmaxLayerTestParams = std::tuple<
|
||||
ov::element::Type, // Model type
|
||||
std::vector<InputShape>, // Input shapes
|
||||
int64_t, // Axis
|
||||
std::string // Target device
|
||||
>;
|
||||
|
||||
class LogSoftmaxLayerTest : public testing::WithParamInterface<logSoftmaxLayerTestParams>,
|
||||
virtual public ov::test::SubgraphBaseTest {
|
||||
public:
|
||||
static std::string getTestCaseName(const testing::TestParamInfo<logSoftmaxLayerTestParams>& obj);
|
||||
|
||||
protected:
|
||||
void SetUp() override;
|
||||
};
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "shared_test_classes/base/ov_subgraph.hpp"
|
||||
|
||||
#include "common_test_utils/test_enums.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
using InputShapesTuple = std::pair<std::vector<size_t>, std::vector<size_t>>;
|
||||
|
||||
typedef std::tuple<
|
||||
std::vector<InputShape>, // Input shapes
|
||||
ov::test::utils::LogicalTypes, // Logical op type
|
||||
ov::test::utils::InputLayerType, // Second input type
|
||||
ov::element::Type, // Model type
|
||||
std::string, // Device name
|
||||
std::map<std::string, std::string> // Additional model configuration
|
||||
> LogicalTestParams;
|
||||
|
||||
class LogicalLayerTest : public testing::WithParamInterface<LogicalTestParams>,
|
||||
virtual public ov::test::SubgraphBaseTest {
|
||||
protected:
|
||||
void SetUp() override;
|
||||
|
||||
public:
|
||||
static std::string getTestCaseName(const testing::TestParamInfo<LogicalTestParams>& obj);
|
||||
};
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -1022,6 +1022,7 @@ ov::runtime::Tensor generate(const
|
||||
comparison::fill_tensor(tensor);
|
||||
return tensor;
|
||||
}
|
||||
|
||||
ov::runtime::Tensor generate(const
|
||||
std::shared_ptr<ov::op::v10::IsNaN>& node,
|
||||
size_t port,
|
||||
@ -1032,6 +1033,44 @@ ov::runtime::Tensor generate(const
|
||||
return tensor;
|
||||
}
|
||||
|
||||
namespace is_inf {
|
||||
template <typename T>
|
||||
void fill_tensor(ov::Tensor& tensor) {
|
||||
int range = ov::shape_size(tensor.get_shape());
|
||||
float startFrom = -static_cast<float>(range) / 2.f;
|
||||
|
||||
auto pointer = tensor.data<T>();
|
||||
testing::internal::Random random(1);
|
||||
for (size_t i = 0; i < range; i++) {
|
||||
if (i % 7 == 0) {
|
||||
pointer[i] = std::numeric_limits<T>::infinity();
|
||||
} else if (i % 7 == 1) {
|
||||
pointer[i] = std::numeric_limits<T>::quiet_NaN();
|
||||
} else if (i % 7 == 3) {
|
||||
pointer[i] = -std::numeric_limits<T>::infinity();
|
||||
} else if (i % 7 == 5) {
|
||||
pointer[i] = -std::numeric_limits<T>::quiet_NaN();
|
||||
} else {
|
||||
pointer[i] = static_cast<T>(startFrom + random.Generate(range));
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace is_inf
|
||||
|
||||
ov::runtime::Tensor generate(const
|
||||
std::shared_ptr<ov::op::v10::IsInf>& node,
|
||||
size_t port,
|
||||
const ov::element::Type& elemType,
|
||||
const ov::Shape& targetShape) {
|
||||
auto tensor = ov::Tensor(elemType, targetShape);
|
||||
if (elemType == ov::element::f16) {
|
||||
is_inf::fill_tensor<ov::float16>(tensor);
|
||||
} else {
|
||||
is_inf::fill_tensor<float>(tensor);
|
||||
}
|
||||
return tensor;
|
||||
}
|
||||
|
||||
namespace color_conversion {
|
||||
enum class ColorFormat {
|
||||
i420,
|
||||
|
@ -0,0 +1,177 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "shared_test_classes/single_op/interpolate.hpp"
|
||||
|
||||
#include "common_test_utils/test_enums.hpp"
|
||||
#include "openvino/op/parameter.hpp"
|
||||
#include "openvino/op/constant.hpp"
|
||||
#include "openvino/op/result.hpp"
|
||||
#include "openvino/op/interpolate.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
std::string InterpolateLayerTest::getTestCaseName(const testing::TestParamInfo<InterpolateLayerTestParams>& obj) {
|
||||
using ov::test::utils::operator<<;
|
||||
|
||||
InterpolateSpecificParams interpolate_params;
|
||||
ov::element::Type model_type;
|
||||
std::vector<InputShape> shapes;
|
||||
ov::Shape target_shape;
|
||||
std::string target_device;
|
||||
std::map<std::string, std::string> additional_config;
|
||||
std::tie(interpolate_params, model_type, shapes, target_shape, target_device, additional_config) = obj.param;
|
||||
std::vector<size_t> pad_begin, pad_end;
|
||||
std::vector<int64_t> axes;
|
||||
std::vector<float> scales;
|
||||
bool antialias;
|
||||
ov::op::v4::Interpolate::InterpolateMode mode;
|
||||
ov::op::v4::Interpolate::ShapeCalcMode shape_calc_mode;
|
||||
ov::op::v4::Interpolate::CoordinateTransformMode coordinate_transform_mode;
|
||||
ov::op::v4::Interpolate::NearestMode nearest_mode;
|
||||
double cube_coef;
|
||||
std::tie(mode, shape_calc_mode, coordinate_transform_mode, nearest_mode, antialias, pad_begin, pad_end, cube_coef, axes, scales) = interpolate_params;
|
||||
|
||||
std::ostringstream result;
|
||||
result << "IS=(";
|
||||
for (size_t i = 0lu; i < shapes.size(); i++) {
|
||||
result << ov::test::utils::partialShape2str({shapes[i].first}) << (i < shapes.size() - 1lu ? "_" : "");
|
||||
}
|
||||
result << ")_TS=";
|
||||
for (size_t i = 0lu; i < shapes.front().second.size(); i++) {
|
||||
result << "{";
|
||||
for (size_t j = 0lu; j < shapes.size(); j++) {
|
||||
result << ov::test::utils::vec2str(shapes[j].second[i]) << (j < shapes.size() - 1lu ? "_" : "");
|
||||
}
|
||||
result << "}_";
|
||||
}
|
||||
result << "TS=" << ov::test::utils::vec2str(target_shape) << "_";
|
||||
result << "InterpolateMode=" << mode << "_";
|
||||
result << "ShapeCalcMode=" << shape_calc_mode << "_";
|
||||
result << "CoordinateTransformMode=" << coordinate_transform_mode << "_";
|
||||
result << "NearestMode=" << nearest_mode << "_";
|
||||
result << "cube_coef=" << cube_coef << "_";
|
||||
result << "Antialias=" << antialias << "_";
|
||||
result << "PB=" << ov::test::utils::vec2str(pad_begin) << "_";
|
||||
result << "PE=" << ov::test::utils::vec2str(pad_end) << "_";
|
||||
result << "Axes=" << ov::test::utils::vec2str(axes) << "_";
|
||||
result << "Scales=" << ov::test::utils::vec2str(scales) << "_";
|
||||
result << "netType=" << model_type.get_type_name() << "_";
|
||||
result << "trgDev=" << target_device;
|
||||
return result.str();
|
||||
}
|
||||
|
||||
void InterpolateLayerTest::SetUp() {
|
||||
InterpolateSpecificParams interpolate_params;
|
||||
ov::element::Type model_type;
|
||||
std::vector<InputShape> shapes;
|
||||
ov::Shape target_shape;
|
||||
std::map<std::string, std::string> additional_config;
|
||||
std::tie(interpolate_params, model_type, shapes, target_shape, targetDevice, additional_config) = this->GetParam();
|
||||
std::vector<size_t> pad_begin, pad_end;
|
||||
std::vector<int64_t> axes;
|
||||
std::vector<float> scales;
|
||||
bool antialias;
|
||||
ov::op::v4::Interpolate::InterpolateMode mode;
|
||||
ov::op::v4::Interpolate::ShapeCalcMode shape_calc_mode;
|
||||
ov::op::v4::Interpolate::CoordinateTransformMode coordinate_transform_mode;
|
||||
ov::op::v4::Interpolate::NearestMode nearest_mode;
|
||||
|
||||
configuration.insert(additional_config.begin(), additional_config.end());
|
||||
|
||||
double cube_coef;
|
||||
std::tie(mode, shape_calc_mode, coordinate_transform_mode, nearest_mode, antialias, pad_begin, pad_end, cube_coef, axes, scales) = interpolate_params;
|
||||
init_input_shapes(shapes);
|
||||
|
||||
auto param = std::make_shared<ov::op::v0::Parameter>(model_type, inputDynamicShapes.front());
|
||||
|
||||
auto sizes_input = std::make_shared<ov::op::v0::Constant>(ov::element::i64, ov::Shape{target_shape.size()}, target_shape);
|
||||
|
||||
auto scales_input = std::make_shared<ov::op::v0::Constant>(ov::element::f32, ov::Shape{scales.size()}, scales);
|
||||
|
||||
ov::op::v4::Interpolate::InterpolateAttrs interpolate_attributes{mode, shape_calc_mode, pad_begin,
|
||||
pad_end, coordinate_transform_mode, nearest_mode, antialias, cube_coef};
|
||||
|
||||
std::shared_ptr<ov::op::v4::Interpolate> interpolate;
|
||||
if (axes.empty()) {
|
||||
interpolate = std::make_shared<ov::op::v4::Interpolate>(param,
|
||||
sizes_input,
|
||||
scales_input,
|
||||
interpolate_attributes);
|
||||
} else {
|
||||
auto axesInput = std::make_shared<ov::op::v0::Constant>(ov::element::i64, ov::Shape{axes.size()}, axes);
|
||||
|
||||
interpolate = std::make_shared<ov::op::v4::Interpolate>(param,
|
||||
sizes_input,
|
||||
scales_input,
|
||||
axesInput,
|
||||
interpolate_attributes);
|
||||
}
|
||||
auto result = std::make_shared<ov::op::v0::Result>(interpolate);
|
||||
|
||||
function = std::make_shared<ov::Model>(result, ov::ParameterVector{param}, "interpolate");
|
||||
}
|
||||
|
||||
std::string Interpolate11LayerTest::getTestCaseName(const testing::TestParamInfo<InterpolateLayerTestParams>& obj) {
|
||||
return InterpolateLayerTest::getTestCaseName(obj);
|
||||
}
|
||||
|
||||
namespace {
|
||||
std::shared_ptr<ov::op::v0::Constant> make_scales_or_sizes_input(ov::op::util::InterpolateBase::ShapeCalcMode shape_calc_mode,
|
||||
const std::vector<size_t>& sizes,
|
||||
const std::vector<float>& scales) {
|
||||
if (shape_calc_mode == ov::op::util::InterpolateBase::ShapeCalcMode::SIZES)
|
||||
return std::make_shared<ov::op::v0::Constant>(ov::element::i64, ov::Shape{sizes.size()}, sizes);
|
||||
else
|
||||
return std::make_shared<ov::op::v0::Constant>(ov::element::f32, ov::Shape{scales.size()}, scales);
|
||||
}
|
||||
}
|
||||
void Interpolate11LayerTest::SetUp() {
|
||||
InterpolateSpecificParams interpolate_params;
|
||||
ov::element::Type model_type;
|
||||
std::vector<InputShape> shapes;
|
||||
ov::Shape target_shape;
|
||||
std::map<std::string, std::string> additional_config;
|
||||
std::tie(interpolate_params, model_type, shapes, target_shape, targetDevice, additional_config) = this->GetParam();
|
||||
std::vector<size_t> pad_begin, pad_end;
|
||||
std::vector<int64_t> axes;
|
||||
std::vector<float> scales;
|
||||
bool antialias;
|
||||
ov::op::v4::Interpolate::InterpolateMode mode;
|
||||
ov::op::v4::Interpolate::ShapeCalcMode shape_calc_mode;
|
||||
ov::op::v4::Interpolate::CoordinateTransformMode coordinate_transform_mode;
|
||||
ov::op::v4::Interpolate::NearestMode nearest_mode;
|
||||
|
||||
configuration.insert(additional_config.begin(), additional_config.end());
|
||||
|
||||
double cube_coef;
|
||||
std::tie(mode, shape_calc_mode, coordinate_transform_mode, nearest_mode, antialias, pad_begin, pad_end, cube_coef, axes, scales) = interpolate_params;
|
||||
init_input_shapes(shapes);
|
||||
|
||||
auto param = std::make_shared<ov::op::v0::Parameter>(model_type, inputDynamicShapes.front());
|
||||
|
||||
auto scales_orsizes_input = make_scales_or_sizes_input(shape_calc_mode, target_shape, scales);
|
||||
|
||||
ov::op::util::InterpolateBase::InterpolateAttrs interpolate_attributes{mode, shape_calc_mode, pad_begin,
|
||||
pad_end, coordinate_transform_mode, nearest_mode, antialias, cube_coef};
|
||||
|
||||
std::shared_ptr<ov::op::v11::Interpolate> interpolate{};
|
||||
if (axes.empty()) {
|
||||
interpolate = std::make_shared<ov::op::v11::Interpolate>(param,
|
||||
scales_orsizes_input,
|
||||
interpolate_attributes);
|
||||
} else {
|
||||
auto axesInput = std::make_shared<ov::op::v0::Constant>(ov::element::i64, ov::Shape{axes.size()}, axes);
|
||||
|
||||
interpolate = std::make_shared<ov::op::v11::Interpolate>(param,
|
||||
scales_orsizes_input,
|
||||
axesInput,
|
||||
interpolate_attributes);
|
||||
}
|
||||
|
||||
auto result = std::make_shared<ov::op::v0::Result>(interpolate);
|
||||
function = std::make_shared<ov::Model>(result, ov::ParameterVector{param}, "interpolate");
|
||||
}
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -0,0 +1,70 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "shared_test_classes/single_op/is_inf.hpp"
|
||||
|
||||
#include "common_test_utils/ov_tensor_utils.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
std::string IsInfLayerTest::getTestCaseName(const testing::TestParamInfo<IsInfParams>& obj) {
|
||||
std::vector<InputShape> shapes;
|
||||
ov::element::Type model_type;
|
||||
bool detect_negative, detect_positive;
|
||||
std::string target_name;
|
||||
std::map<std::string, std::string> additional_config;
|
||||
std::tie(shapes, detect_negative, detect_positive, model_type, target_name, additional_config) = obj.param;
|
||||
std::ostringstream result;
|
||||
|
||||
result << "IS=(";
|
||||
for (size_t i = 0lu; i < shapes.size(); i++) {
|
||||
result << ov::test::utils::partialShape2str({shapes[i].first}) << (i < shapes.size() - 1lu ? "_" : "");
|
||||
}
|
||||
result << ")_TS=";
|
||||
for (size_t i = 0lu; i < shapes.front().second.size(); i++) {
|
||||
result << "{";
|
||||
for (size_t j = 0lu; j < shapes.size(); j++) {
|
||||
result << ov::test::utils::vec2str(shapes[j].second[i]) << (j < shapes.size() - 1lu ? "_" : "");
|
||||
}
|
||||
result << "}_";
|
||||
}
|
||||
result << ")_detect_negative=" << (detect_negative ? "True" : "False") << "_";
|
||||
result << "detect_positive=" << (detect_positive ? "True" : "False") << "_";
|
||||
result << "model_type=" << model_type << "_";
|
||||
result << "trgDev=" << target_name;
|
||||
|
||||
for (auto const& config_item : additional_config) {
|
||||
result << "_config_item=" << config_item.first << "=" << config_item.second;
|
||||
}
|
||||
return result.str();
|
||||
}
|
||||
|
||||
void IsInfLayerTest::SetUp() {
|
||||
std::vector<InputShape> shapes;
|
||||
ElementType model_type;
|
||||
bool detect_negative, detect_positive;
|
||||
std::map<std::string, std::string> additional_config;
|
||||
std::tie(shapes, detect_negative, detect_positive, model_type, targetDevice, additional_config) = this->GetParam();
|
||||
|
||||
init_input_shapes(shapes);
|
||||
configuration.insert(additional_config.begin(), additional_config.end());
|
||||
|
||||
ov::ParameterVector parameters;
|
||||
for (auto&& shape : inputDynamicShapes) {
|
||||
parameters.push_back(std::make_shared<ov::op::v0::Parameter>(model_type, shape));
|
||||
}
|
||||
parameters[0]->set_friendly_name("Data");
|
||||
|
||||
ov::op::v10::IsInf::Attributes attributes {detect_negative, detect_positive};
|
||||
auto is_inf = std::make_shared<ov::op::v10::IsInf>(parameters[0], attributes);
|
||||
|
||||
ov::ResultVector results;
|
||||
for (int i = 0; i < is_inf->get_output_size(); i++) {
|
||||
results.push_back(std::make_shared<ov::op::v0::Result>(is_inf->output(i)));
|
||||
}
|
||||
|
||||
function = std::make_shared<ov::Model>(results, parameters, "IsInf");
|
||||
}
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -0,0 +1,54 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "shared_test_classes/single_op/log_softmax.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
std::string LogSoftmaxLayerTest::getTestCaseName(const testing::TestParamInfo<logSoftmaxLayerTestParams>& obj) {
|
||||
ov::element::Type model_type;
|
||||
std::vector<InputShape> shapes;
|
||||
int64_t axis;
|
||||
std::string target_device;
|
||||
std::tie(model_type, shapes, axis, target_device) = obj.param;
|
||||
|
||||
std::ostringstream result;
|
||||
result << "IS=(";
|
||||
for (size_t i = 0lu; i < shapes.size(); i++) {
|
||||
result << ov::test::utils::partialShape2str({shapes[i].first}) << (i < shapes.size() - 1lu ? "_" : "");
|
||||
}
|
||||
result << ")_TS=";
|
||||
for (size_t i = 0lu; i < shapes.front().second.size(); i++) {
|
||||
result << "{";
|
||||
for (size_t j = 0lu; j < shapes.size(); j++) {
|
||||
result << ov::test::utils::vec2str(shapes[j].second[i]) << (j < shapes.size() - 1lu ? "_" : "");
|
||||
}
|
||||
result << "}_";
|
||||
}
|
||||
|
||||
result << "modelType=" << model_type.get_type_name() << "_";
|
||||
result << "axis=" << axis << "_";
|
||||
result << "trgDev=" << target_device;
|
||||
|
||||
return result.str();
|
||||
}
|
||||
|
||||
void LogSoftmaxLayerTest::SetUp() {
|
||||
ov::element::Type model_type;
|
||||
std::vector<InputShape> shapes;
|
||||
int64_t axis;
|
||||
|
||||
std::tie(model_type, shapes, axis, targetDevice) = GetParam();
|
||||
init_input_shapes(shapes);
|
||||
|
||||
auto param = std::make_shared<ov::op::v0::Parameter>(model_type, inputDynamicShapes.front());
|
||||
|
||||
const auto log_softmax = std::make_shared<ov::op::v5::LogSoftmax>(param, axis);
|
||||
|
||||
auto result = std::make_shared<ov::op::v0::Result>(log_softmax);
|
||||
|
||||
function = std::make_shared<ov::Model>(result, ov::ParameterVector{param}, "logSoftmax");
|
||||
}
|
||||
} // namespace test
|
||||
} // namespace ov
|
@ -0,0 +1,74 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "shared_test_classes/single_op/logical.hpp"
|
||||
|
||||
#include "common_test_utils/ov_tensor_utils.hpp"
|
||||
#include "ov_models/builders.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
std::string LogicalLayerTest::getTestCaseName(const testing::TestParamInfo<LogicalTestParams>& obj) {
|
||||
std::vector<InputShape> shapes;
|
||||
ov::test::utils::LogicalTypes comparisonOpType;
|
||||
ov::test::utils::InputLayerType second_input_type;
|
||||
ov::element::Type model_type;
|
||||
std::string device_name;
|
||||
std::map<std::string, std::string> additional_config;
|
||||
std::tie(shapes, comparisonOpType, second_input_type, model_type, device_name, additional_config) = obj.param;
|
||||
|
||||
std::ostringstream result;
|
||||
result << "IS=(";
|
||||
for (size_t i = 0lu; i < shapes.size(); i++) {
|
||||
result << ov::test::utils::partialShape2str({shapes[i].first}) << (i < shapes.size() - 1lu ? "_" : "");
|
||||
}
|
||||
result << ")_TS=";
|
||||
for (size_t i = 0lu; i < shapes.front().second.size(); i++) {
|
||||
result << "{";
|
||||
for (size_t j = 0lu; j < shapes.size(); j++) {
|
||||
result << ov::test::utils::vec2str(shapes[j].second[i]) << (j < shapes.size() - 1lu ? "_" : "");
|
||||
}
|
||||
result << "}_";
|
||||
}
|
||||
result << "comparisonOpType=" << comparisonOpType << "_";
|
||||
result << "second_input_type=" << second_input_type << "_";
|
||||
result << "netPRC=" << model_type.get_type_name() << "_";
|
||||
result << "trgDev=" << device_name;
|
||||
return result.str();
|
||||
}
|
||||
|
||||
void LogicalLayerTest::SetUp() {
|
||||
std::vector<InputShape> shapes;
|
||||
ov::test::utils::LogicalTypes logical_op_type;
|
||||
ov::test::utils::InputLayerType second_input_type;
|
||||
ov::element::Type model_type;
|
||||
std::map<std::string, std::string> additional_config;
|
||||
|
||||
std::tie(shapes, logical_op_type, second_input_type, model_type, targetDevice, additional_config) = this->GetParam();
|
||||
init_input_shapes(shapes);
|
||||
|
||||
configuration.insert(additional_config.begin(), additional_config.end());
|
||||
|
||||
ov::ParameterVector params {std::make_shared<ov::op::v0::Parameter>(model_type, inputDynamicShapes[0])};
|
||||
|
||||
std::shared_ptr<ov::Node> logical_node;
|
||||
if (ov::test::utils::LogicalTypes::LOGICAL_NOT != logical_op_type) {
|
||||
std::shared_ptr<ov::Node> secondInput;
|
||||
if (ov::test::utils::InputLayerType::CONSTANT == second_input_type) {
|
||||
auto tensor = ov::test::utils::create_and_fill_tensor(model_type, targetStaticShapes[0][1]);
|
||||
secondInput = std::make_shared<ov::op::v0::Constant>(tensor);
|
||||
} else {
|
||||
auto param = std::make_shared<ov::op::v0::Parameter>(model_type, inputDynamicShapes[1]);
|
||||
secondInput = param;
|
||||
params.push_back(param);
|
||||
}
|
||||
logical_node = ngraph::builder::makeLogical(params[0], secondInput, logical_op_type);
|
||||
} else {
|
||||
logical_node = std::make_shared<ov::op::v1::LogicalNot>(params[0]);
|
||||
}
|
||||
|
||||
function = std::make_shared<ov::Model>(logical_node, params, "Logical");
|
||||
}
|
||||
} // namespace test
|
||||
} // namespace ov
|
Loading…
Reference in New Issue
Block a user