Skip to content

Commit

Permalink
Remove WA for vpu repo with CommonTestUtils namespace (openvinotoolki…
Browse files Browse the repository at this point in the history
  • Loading branch information
olpipi committed Aug 22, 2023
1 parent 7e72456 commit de65abc
Show file tree
Hide file tree
Showing 25 changed files with 52 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_Snippets_MHAQuantMatMul0, MHAQuantMatMul0,
::testing::Values(false), // The graph doesn't contain Multiply
::testing::Values(8), // FQ on input + MHA + Transpose on output + 4 Reshapes + Deq Mul
::testing::Values(3), // FQ on input + MHA + Deq Mul
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(ov::test::utils::DEVICE_CPU),
::testing::Values(CPUTestUtils::cpuEmptyPluginConfig)),
MHA::getTestCaseName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MatmulBrgemmInt8Test : public testing::WithParamInterface<MatmulBrgemmInt8
std::tie(supportedInputShapes, isFC, inType, outType, cpuParams) = obj.param;

std::ostringstream result;
result << "IS=" << CommonTestUtils::vec2str(supportedInputShapes) << "_";
result << "IS=" << ov::test::utils::vec2str(supportedInputShapes) << "_";
result << (isFC ? "FullyConnected" : "MatMul") << "_";
result << "InputType=" << inType << "_";
result << "OutputType=" << outType << "_";
Expand All @@ -56,7 +56,7 @@ class MatmulBrgemmInt8Test : public testing::WithParamInterface<MatmulBrgemmInt8
ElementType inType;
ElementType outType;
void SetUp() override {
targetDevice = CommonTestUtils::DEVICE_CPU;
targetDevice = ov::test::utils::DEVICE_CPU;
SizeVector inShapes;
CPUSpecificParams cpuParams;
std::tie(inShapes, isFC, inType, outType, cpuParams) = this->GetParam();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_MHAQuant_Pattern0, MHAQuantTest,
::testing::Values(0),
::testing::Values(ExpectedNodes{{"Subgraph", 5}, // FQs on inputs x 3 + MHA + Deq Mul
{"Transpose", 1}}), // Transpose between MHA and Deq Mul
::testing::Values(CommonTestUtils::DEVICE_CPU)),
::testing::Values(ov::test::utils::DEVICE_CPU)),
MHAQuantTest::getTestCaseName);


Expand All @@ -604,7 +604,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_MHAQuant_Pattern1, MHAQuantTest,
::testing::Values(1),
::testing::Values(ExpectedNodes{{"Subgraph", 3}, // FQ on input + MHA + Deq Mul
{"Transpose", 1}}), // Transpose between MHA and Deq Mul
::testing::Values(CommonTestUtils::DEVICE_CPU)),
::testing::Values(ov::test::utils::DEVICE_CPU)),
MHAQuantTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_MHAQuant_Pattern2, MHAQuantTest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class AdaptiveAvgPoolV8CpuShapeInferenceTest : public unit_test::OpCpuShapeInfe
StaticShape tmp_exp_shape;
std::tie(tmp_input_shapes, tmp_axes, tmp_exp_shape) = obj.param;
std::ostringstream result;
result << "IS" << CommonTestUtils::vec2str(tmp_input_shapes) << "_";
result << "sd" << CommonTestUtils::vec2str(tmp_axes) << "_";
result << "IS" << ov::test::utils::vec2str(tmp_input_shapes) << "_";
result << "sd" << ov::test::utils::vec2str(tmp_axes) << "_";
result << "exp_shape" << tmp_exp_shape;
return result.str();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class AdaptiveMaxPoolV8CpuShapeInferenceTest : public unit_test::OpCpuShapeInfe
StaticShape tmp_exp_shape;
std::tie(tmp_input_shapes, tmp_axes, tmp_exp_shape) = obj.param;
std::ostringstream result;
result << "IS" << CommonTestUtils::vec2str(tmp_input_shapes) << "_";
result << "sd" << CommonTestUtils::vec2str(tmp_axes) << "_";
result << "IS" << ov::test::utils::vec2str(tmp_input_shapes) << "_";
result << "sd" << ov::test::utils::vec2str(tmp_axes) << "_";
result << "exp_shape" << tmp_exp_shape;
return result.str();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class OneHotCpuShapeInferenceTest : public unit_test::OpCpuShapeInferenceTest<o
StaticShape tmp_exp_shape;
std::tie(tmp_input_shapes, tmp_depth, tmp_on, tmp_off, tmp_exp_shape) = obj.param;
std::ostringstream result;
result << "IS" << CommonTestUtils::vec2str(tmp_input_shapes) << "_";
result << "IS" << ov::test::utils::vec2str(tmp_input_shapes) << "_";
result << "depth" << tmp_depth << "_";
result << "on" << tmp_on << "_";
result << "off" << tmp_off << "_";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ class PriorBoxV0CpuShapeInferenceTest : public unit_test::OpCpuShapeInferenceTe
StaticShape tmp_exp_shape;
std::tie(tmp_input_shapes, tmp_attrs, tmp_data, tmp_exp_shape) = obj.param;
std::ostringstream result;
result << "IS" << CommonTestUtils::vec2str(tmp_input_shapes) << "_";
result << "min_size" << CommonTestUtils::vec2str(tmp_attrs.min_size) << "_";
result << "max_size" << CommonTestUtils::vec2str(tmp_attrs.max_size) << "_";
result << "density" << CommonTestUtils::vec2str(tmp_attrs.density) << "_";
result << "fixed_ratio" << CommonTestUtils::vec2str(tmp_attrs.fixed_ratio) << "_";
result << "fixed_size" << CommonTestUtils::vec2str(tmp_attrs.fixed_size) << "_";
result << "IS" << ov::test::utils::vec2str(tmp_input_shapes) << "_";
result << "min_size" << ov::test::utils::vec2str(tmp_attrs.min_size) << "_";
result << "max_size" << ov::test::utils::vec2str(tmp_attrs.max_size) << "_";
result << "density" << ov::test::utils::vec2str(tmp_attrs.density) << "_";
result << "fixed_ratio" << ov::test::utils::vec2str(tmp_attrs.fixed_ratio) << "_";
result << "fixed_size" << ov::test::utils::vec2str(tmp_attrs.fixed_size) << "_";
result << "clip(" << unit_test::boolToString(tmp_attrs.clip) << ")_";
result << "flip(" << unit_test::boolToString(tmp_attrs.flip) << ")_";
result << "step(" << tmp_attrs.step << ")_";
result << "offset(" << tmp_attrs.offset << ")_";
result << "variance" << CommonTestUtils::vec2str(tmp_attrs.variance) << "_";
result << "variance" << ov::test::utils::vec2str(tmp_attrs.variance) << "_";
result << "scale_all_sizes(" << unit_test::boolToString(tmp_attrs.scale_all_sizes) << ")_";
result << "exp_shape(" << tmp_exp_shape << ")";
return result.str();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ class PriorBoxClusteredV0CpuShapeInferenceTest : public unit_test::OpCpuShapeIn
std::tie(tmp_input_shapes, tmp_attrs, tmp_data, tmp_exp_shape) = obj.param;
std::ostringstream result;

result << "IS" << CommonTestUtils::vec2str(tmp_input_shapes) << "_";
result << "widths" << CommonTestUtils::vec2str(tmp_attrs.widths) << "_";
result << "heights" << CommonTestUtils::vec2str(tmp_attrs.heights) << "_";
result << "IS" << ov::test::utils::vec2str(tmp_input_shapes) << "_";
result << "widths" << ov::test::utils::vec2str(tmp_attrs.widths) << "_";
result << "heights" << ov::test::utils::vec2str(tmp_attrs.heights) << "_";
result << "clip(" << unit_test::boolToString(tmp_attrs.clip) << ")_";
result << "step_widths(" << tmp_attrs.step_widths<< ")_";
result << "step_heights(" << tmp_attrs.step_heights << ")_";
result << "offset(" << tmp_attrs.offset << ")_";
result << "variances" << CommonTestUtils::vec2str(tmp_attrs.variances) << "_";
result << "variances" << ov::test::utils::vec2str(tmp_attrs.variances) << "_";
result << "exp_shape(" << tmp_exp_shape << ")";
return result.str();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class ReshapeCpuShapeInferenceTest : public unit_test::OpCpuShapeInferenceTest<
bool tmp_specialZero;
std::tie(tmp_input_shapes, tmp_axes, tmp_exp_shape, tmp_specialZero) = obj.param;
std::ostringstream result;
result << "IS" << CommonTestUtils::vec2str(tmp_input_shapes) << "_";
result << "axes" << CommonTestUtils::vec2str(tmp_axes) << "_";
result << "IS" << ov::test::utils::vec2str(tmp_input_shapes) << "_";
result << "axes" << ov::test::utils::vec2str(tmp_axes) << "_";
result << "exp_shape(" << tmp_exp_shape << ")_";
result << "specalZero(" << unit_test::boolToString(tmp_specialZero) << ")";
return result.str();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class SqueezeCpuShapeInferenceTest : public unit_test::OpCpuShapeInferenceTest<
StaticShape tmp_exp_shape;
std::tie(tmp_input_shapes, tmp_axes, tmp_exp_shape) = obj.param;
std::ostringstream result;
result << "IS" << CommonTestUtils::vec2str(tmp_input_shapes) << "_";
result << "axes" << CommonTestUtils::vec2str(tmp_axes) << "_";
result << "IS" << ov::test::utils::vec2str(tmp_input_shapes) << "_";
result << "axes" << ov::test::utils::vec2str(tmp_axes) << "_";
result << "exp_shape(" << tmp_exp_shape << ")";
return result.str();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class StridedSliceCpuShapeInferenceTest : public unit_test::OpCpuShapeInference
StaticShape tmp_exp_shape;
std::tie(tmp_input_shapes, tmp_data, tmp_begin_mask, tmp_end_mask, tmp_exp_shape) = obj.param;
std::ostringstream result;
result << "IS" << CommonTestUtils::vec2str(tmp_input_shapes) << "_";
result << "begin" << CommonTestUtils::vec2str(tmp_data[BEGIN]) << "_";
result << "end" << CommonTestUtils::vec2str(tmp_data[END]) << "_";
result << "stride" << CommonTestUtils::vec2str(tmp_data[STRIDE]) << "_";
result << "begin_mask" << CommonTestUtils::vec2str(tmp_begin_mask) << "_";
result << "end_mask" << CommonTestUtils::vec2str(tmp_end_mask) << "_";
result << "IS" << ov::test::utils::vec2str(tmp_input_shapes) << "_";
result << "begin" << ov::test::utils::vec2str(tmp_data[BEGIN]) << "_";
result << "end" << ov::test::utils::vec2str(tmp_data[END]) << "_";
result << "stride" << ov::test::utils::vec2str(tmp_data[STRIDE]) << "_";
result << "begin_mask" << ov::test::utils::vec2str(tmp_begin_mask) << "_";
result << "end_mask" << ov::test::utils::vec2str(tmp_end_mask) << "_";
result << "exp_shape(" << tmp_exp_shape << ")";
return result.str();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class TransposeCpuShapeInferenceTest : public unit_test::OpCpuShapeInferenceTes
StaticShape tmp_exp_shape;
std::tie(tmp_input_shapes, tmp_transpose_order, tmp_exp_shape) = obj.param;
std::ostringstream result;
result << "input_shapes(" << CommonTestUtils::vec2str(tmp_input_shapes) << ")_";
result << "order(" << CommonTestUtils::vec2str(tmp_transpose_order) << ")_";
result << "input_shapes(" << ov::test::utils::vec2str(tmp_input_shapes) << ")_";
result << "order(" << ov::test::utils::vec2str(tmp_transpose_order) << ")_";
result << "exp_shape(" << tmp_exp_shape << ")";
return result.str();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class UnsqueezeCpuShapeInferenceTest : public unit_test::OpCpuShapeInferenceTes
StaticShape tmp_exp_shape;
std::tie(tmp_input_shapes, tmp_axes, tmp_exp_shape) = obj.param;
std::ostringstream result;
result << "IS" << CommonTestUtils::vec2str(tmp_input_shapes) << "_";
result << "axes" << CommonTestUtils::vec2str(tmp_axes) << "_";
result << "IS" << ov::test::utils::vec2str(tmp_input_shapes) << "_";
result << "axes" << ov::test::utils::vec2str(tmp_axes) << "_";
result << "exp_shape(" << tmp_exp_shape << ")";
return result.str();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ using ConcatRestrictionsParamsTuple = typename std::tuple<InferenceEngine::SizeV

namespace ConcatTestsDefinitions {

using namespace CommonTestUtils;
using namespace InferenceEngine;
using namespace ngraph::builder;
using namespace ov;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class GatherTransposeMergeTest : public testing::WithParamInterface<GatherTransp
}

std::ostringstream result;
result << "Shape=" << CommonTestUtils::vec2str(input_shape) << "_";
result << "Shape=" << ov::test::utils::vec2str(input_shape) << "_";
result << "netPRC=" << net_type << "_";
result << "trgDev=" << target_device;
for (auto const& conf_i : conf) {
Expand Down Expand Up @@ -186,7 +186,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_merge_transpose_gather,
TransposeGatherTest,
::testing::Combine(::testing::ValuesIn(input_shapes),
::testing::ValuesIn(input_precisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(ov::test::utils::DEVICE_GNA),
::testing::ValuesIn(configs),
::testing::ValuesIn(target_configs)),
TransposeGatherTest::get_test_case_name);
Expand All @@ -195,7 +195,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_merge_transpose_gather,
GatherTransposeTest,
::testing::Combine(::testing::ValuesIn(input_shapes),
::testing::ValuesIn(input_precisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(ov::test::utils::DEVICE_GNA),
::testing::ValuesIn(configs),
::testing::ValuesIn(target_configs)),
GatherTransposeTest::get_test_case_name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ typedef std::tuple<ov::element::Type, // Net precision
>
GatherTransposeMergeTestParams;

class GatherTransposeMergeBase : public CommonTestUtils::TestsCommon,
class GatherTransposeMergeBase : public ov::test::TestsCommon,
public ::testing::WithParamInterface<GatherTransposeMergeTestParams> {
public:
static std::string get_test_name(const testing::TestParamInfo<GatherTransposeMergeTestParams>& obj) {
Expand All @@ -63,7 +63,7 @@ class GatherTransposeMergeBase : public CommonTestUtils::TestsCommon,

std::ostringstream result;
result << "netPRC=" << net_type << "_";
result << "Shape=" << CommonTestUtils::vec2str(input_shape);
result << "Shape=" << ov::test::utils::vec2str(input_shape);

return result.str();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct TestData {
typedef std::tuple<TestData> // Transpose order
test_params;

class TransposeCompressTest : public CommonTestUtils::TestsCommon, public ::testing::WithParamInterface<test_params> {
class TransposeCompressTest : public ov::test::TestsCommon, public ::testing::WithParamInterface<test_params> {
public:
static std::string getTestCaseName(const testing::TestParamInfo<test_params>& obj) {
TestData test_shapes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_Interpolate_11_Basic, Interpolate11LayerTest, ::t
::testing::Values(InferenceEngine::Layout::ANY),
::testing::ValuesIn(inShapes),
::testing::ValuesIn(targetShapes),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::Values(ov::test::utils::DEVICE_GPU),
::testing::Values(additional_config)),
Interpolate11LayerTest::getTestCaseName);

Expand Down Expand Up @@ -337,7 +337,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_Interpolate_11_Pillow, Interpolate11LayerTest, ::
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>{1, 1, 23, 23}),
::testing::Values(std::vector<size_t>{1, 1, 50, 50}),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::Values(ov::test::utils::DEVICE_GPU),
::testing::Values(additional_config)),
Interpolate11LayerTest::getTestCaseName);

Expand All @@ -361,7 +361,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_Interpolate_11_Pillow_Horizontal, Interpolate11La
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>{1, 1, 23, 23}),
::testing::Values(std::vector<size_t>{1, 1, 25, 50}),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::Values(ov::test::utils::DEVICE_GPU),
::testing::Values(additional_config)),
Interpolate11LayerTest::getTestCaseName);

Expand All @@ -385,7 +385,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_Interpolate_11_Pillow_Vertical, Interpolate11Laye
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>{1, 1, 23, 23}),
::testing::Values(std::vector<size_t>{1, 1, 50, 25}),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::Values(ov::test::utils::DEVICE_GPU),
::testing::Values(additional_config)),
Interpolate11LayerTest::getTestCaseName);

Expand All @@ -409,7 +409,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_Interpolate_11_Pillow_Vertical_BF, Interpolate11L
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(std::vector<size_t>{23, 23, 2, 2}),
::testing::Values(std::vector<size_t>{52, 26, 2, 2}),
::testing::Values(CommonTestUtils::DEVICE_GPU),
::testing::Values(ov::test::utils::DEVICE_GPU),
::testing::Values(additional_config)),
Interpolate11LayerTest::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,18 @@ std::string InterpolateLayerTest::getTestCaseName(const testing::TestParamInfo<I
double cubeCoef;
std::tie(mode, shapeCalcMode, coordinateTransformMode, nearestMode, antialias, padBegin, padEnd, cubeCoef, axes, scales) = interpolateParams;
std::ostringstream result;
result << "IS=" << CommonTestUtils::vec2str(inputShapes) << "_";
result << "TS=" << CommonTestUtils::vec2str(targetShapes) << "_";
result << "IS=" << ov::test::utils::vec2str(inputShapes) << "_";
result << "TS=" << ov::test::utils::vec2str(targetShapes) << "_";
result << "InterpolateMode=" << mode << "_";
result << "ShapeCalcMode=" << shapeCalcMode << "_";
result << "CoordinateTransformMode=" << coordinateTransformMode << "_";
result << "NearestMode=" << nearestMode << "_";
result << "CubeCoef=" << cubeCoef << "_";
result << "Antialias=" << antialias << "_";
result << "PB=" << CommonTestUtils::vec2str(padBegin) << "_";
result << "PE=" << CommonTestUtils::vec2str(padEnd) << "_";
result << "Axes=" << CommonTestUtils::vec2str(axes) << "_";
result << "Scales=" << CommonTestUtils::vec2str(scales) << "_";
result << "PB=" << ov::test::utils::vec2str(padBegin) << "_";
result << "PE=" << ov::test::utils::vec2str(padEnd) << "_";
result << "Axes=" << ov::test::utils::vec2str(axes) << "_";
result << "Scales=" << ov::test::utils::vec2str(scales) << "_";
result << "netPRC=" << netPrecision.name() << "_";
result << "inPRC=" << inPrc.name() << "_";
result << "outPRC=" << outPrc.name() << "_";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,3 @@ size_t getVmRSSInKB();
} // namespace utils
} // namespace test
} // namespace ov

// openvino_contrib and NPU repo use CommonTestUtils::
// so we need to add these names to CommonTestUtils namespace
namespace CommonTestUtils {
using ov::test::utils::vec2str;
using ov::test::utils::combineParams;
using ov::test::utils::OpType;
using ov::test::utils::GetTimestamp;
} // namespace CommonTestUtils
Original file line number Diff line number Diff line change
Expand Up @@ -481,11 +481,3 @@ OPENVINO_SUPPRESS_DEPRECATED_END
} // namespace test
} // namespace ov


// openvino_contrib and NPU repo use CommonTestUtils::
// so we need to add these names to CommonTestUtils namespace
namespace CommonTestUtils {
using ov::test::utils::ie_abs;
using ov::test::utils::generate_float_numbers;
using ov::test::utils::fill_data_roi;
} // namespace CommonTestUtils
Loading

0 comments on commit de65abc

Please sign in to comment.