Revise equal (#6605)

* update spec, init backend file for equal op

* add backend, visitors, serialize SLT tests

* add backend test to manifest cause of mismatch of output type with cpu plugin

* add equal to list of trusted ops and to cmakelist file

* refactor backend tests to the new template

* refactor spec

* remove external link in numpy broadcast and update example

* remove comparison.in.cpp file and related tests from manifest

* fix example

* remove redundant arguments

* refactor backend tests

* add pdpd broadcast to the spec, and different precison to SLT test

* add precisions to SLT cpu

* remove unsupported type from SLT

* revert the deletion of comparison.in.cpp file

* remove visitors test, since it will be added in the other PR

* remove equal from CMakeLists.txt

* refactor links in the spec

* revert unwanted changes

* remove equal from unit test manifest

* revert links modification in spec

* add namespace

* split SSLTs for comaprison ops into seperate files

* fix SSLTs names

* add missing new lines

* udpate output type in spec

* rafactor numeric backend test to template

* merge numeric template tests into equal
This commit is contained in:
Bartek Szmelczynski
2021-08-11 12:04:30 +02:00
committed by GitHub
parent 5292de5338
commit 289df8db27
14 changed files with 473 additions and 100 deletions

View File

@@ -4,35 +4,10 @@
**Category**: Comparison binary operation
**Short description**: *Equal* performs element-wise comparison operation with two given tensors applying multi-directional broadcast rules.
**Attributes**:
* *auto_broadcast*
* **Description**: specifies rules used for auto-broadcasting of input tensors.
* **Range of values**:
* *none* - no auto-broadcasting is allowed, all input shapes should match
* *numpy* - numpy broadcasting rules, aligned with ONNX Broadcasting. Description is available in <a href="https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md">ONNX docs</a>.
* **Type**: string
* **Default value**: "numpy"
* **Required**: *no*
**Inputs**
* **1**: A tensor of type *T*. **Required.**
* **2**: A tensor of type *T*. **Required.**
**Outputs**
* **1**: The result of element-wise comparison operation. A tensor of type boolean.
**Types**
* *T*: arbitrary supported type.
**Short description**: *Equal* performs element-wise comparison operation with two given input tensors applying multi-directional broadcast rules specified in the *auto_broadcast* attribute.
**Detailed description**
Before performing arithmetic operation, input tensors *a* and *b* are broadcasted if their shapes are different and `auto_broadcast` attributes is not `none`. Broadcasting is performed according to `auto_broadcast` value.
Before performing arithmetic operation, input tensors *a* and *b* are broadcasted if their shapes are different and *auto_broadcast* attributes is not *none*. Broadcasting is performed according to *auto_broadcast* value.
After broadcasting *Equal* does the following with the input tensors *a* and *b*:
@@ -40,12 +15,40 @@ After broadcasting *Equal* does the following with the input tensors *a* and *b*
o_{i} = a_{i} == b_{i}
\f]
**Attributes**:
* *auto_broadcast*
* **Description**: specifies rules used for auto-broadcasting of input tensors.
* **Range of values**:
* *none* - no auto-broadcasting is allowed, all input shapes should match,
* *numpy* - numpy broadcasting rules, description is available in [Broadcast Rules For Elementwise Operations](../broadcast_rules.md),
* *pdpd* - PaddlePaddle-style implicit broadcasting, description is available in [Broadcast Rules For Elementwise Operations](../broadcast_rules.md).
* **Type**: string
* **Default value**: "numpy"
* **Required**: *no*
**Inputs**
* **1**: A tensor of type *T* and arbitrary shape. **Required.**
* **2**: A tensor of type *T* and arbitrary shape. **Required.**
**Outputs**
* **1**: The result of element-wise **comparison** operation applied to the input tensors. A tensor of type *T_BOOL* and the same shape equal to broadcasted shape of two inputs.
**Types**
* *T*: arbitrary supported type.
* *T_BOOL*: `boolean`.
**Examples**
*Example 1*
*Example 1: no broadcast*
```xml
<layer ... type="Equal">
<data auto_broadcast="none"/>
<input>
<port id="0">
<dim>256</dim>
@@ -65,9 +68,10 @@ o_{i} = a_{i} == b_{i}
</layer>
```
*Example 2: broadcast*
*Example 2: numpy broadcast*
```xml
<layer ... type="Equal">
<data auto_broadcast="numpy"/>
<input>
<port id="0">
<dim>8</dim>

View File

@@ -75,6 +75,48 @@ std::vector<RefComparisonParams> generateComparisonCombinedParams() {
INSTANTIATE_TEST_SUITE_P(smoke_Comparison_With_Hardcoded_Refs, ReferenceComparisonLayerTest, ::testing::ValuesIn(generateComparisonCombinedParams()),
ReferenceComparisonLayerTest::getTestCaseName);
template <element::Type_t IN_ET>
std::vector<RefComparisonParams> generateNumericParams(const element::Type& type) {
using T = typename element_type_traits<IN_ET>::value_type;
std::vector<RefComparisonParams> compParams {
Builder {}
.compType(ComparisonTypes::EQUAL)
.input1({{4}, type, std::vector<T> {-2.5f, 25.5f, 2.25f, NAN}})
.input2({{4}, type, std::vector<T> {10.0f, 5.0f, 2.25f, 10.0f}})
.expected({{4}, element::boolean, std::vector<char> {0, 0, 1, 0, }}),
Builder {}
.compType(ComparisonTypes::EQUAL)
.input1({{2, 3}, type, std::vector<T> {0.0f, NAN, NAN, 1.0f, 21.0f, -INFINITY}})
.input2({{2, 3}, type, std::vector<T> {1.0f, NAN, 23.0f, 1.0f, 19.0f, 21.0f}})
.expected({{2, 3}, element::boolean, std::vector<char> {0, 0, 0, 1, 0, 0}}),
Builder {}
.compType(ComparisonTypes::EQUAL)
.input1({{1}, type, std::vector<T> {INFINITY}})
.input2({{1}, type, std::vector<T> {INFINITY}})
.expected({{1}, element::boolean, std::vector<char> {1}}),
Builder {}
.compType(ComparisonTypes::EQUAL)
.input1({{5}, type, std::vector<T> {-2.5f, 25.5f, 2.25f, INFINITY, 6.0f}})
.input2({{5}, type, std::vector<T> {10.0f, 5.0f, 2.25f, 10.0f, -INFINITY}})
.expected({{5}, element::boolean, std::vector<char> {0, 0, 1, 0, 0}})};
return compParams;
}
std::vector<RefComparisonParams> generateNumericCombinedParams() {
const std::vector<std::vector<RefComparisonParams>> compTypeParams {
generateNumericParams<element::Type_t::f16>(element::f16),
generateNumericParams<element::Type_t::f32>(element::f32)};
std::vector<RefComparisonParams> combinedParams;
for (const auto& params : compTypeParams) {
combinedParams.insert(combinedParams.end(), params.begin(), params.end());
}
return combinedParams;
}
INSTANTIATE_TEST_SUITE_P(smoke_Numeric_With_Hardcoded_Refs, ReferenceComparisonLayerTest, ::testing::ValuesIn(generateNumericCombinedParams()),
ReferenceComparisonLayerTest::getTestCaseName);
} // namespace
} // namespace ComparisonOpsRefTestDefinitions
} // namespace reference_tests

View File

@@ -0,0 +1,16 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "shared_test_classes/single_layer/comparison.hpp"
struct ComparisionOpsData {
const std::map<std::vector<size_t>, std::vector<std::vector<size_t>>> inputShapes;
const std::vector<InferenceEngine::Precision> inputsPrecisions;
const std::vector<ngraph::helpers::InputLayerType> secondInputTypes;
const std::map<std::string, std::string> additional_config;
const ngraph::helpers::ComparisonTypes opType;
const InferenceEngine::Precision ieInputPrecision;
const InferenceEngine::Precision ieOutputPrecision;
const std::string deviceName;
};

View File

@@ -0,0 +1,63 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "comparison_ops.hpp"
using namespace LayerTestsDefinitions;
using namespace LayerTestsDefinitions::ComparisonParams;
namespace {
TEST_P(ComparisonLayerTest, Serialize) {
Serialize();
}
ComparisionOpsData data = {
// inputsShape
{
{{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}}},
{{1, 3, 20}, {{20}, {2, 1, 1}}},
{{2, 17, 3, 4}, {{4}, {1, 3, 4}, {2, 1, 3, 4}}},
{{2, 17, 3, 4}, {{4}, {1, 3, 4}, {141, 1, 3, 4}}},
{{2, 1, 1, 3, 1}, {{1}, {1, 3, 4}, {2, 1, 3, 4}, {1, 1, 1, 1, 1}}},
},
// inputsPrecisions
{
InferenceEngine::Precision::FP64,
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
InferenceEngine::Precision::I32,
InferenceEngine::Precision::U32,
InferenceEngine::Precision::BOOL,
},
// secondIinputsType
{
ngraph::helpers::InputLayerType::CONSTANT,
ngraph::helpers::InputLayerType::PARAMETER,
},
// additionalConfig
{},
// opType
ngraph::helpers::ComparisonTypes::EQUAL,
// ieInputPrecision
InferenceEngine::Precision::UNSPECIFIED,
// ieOutputPrecision
InferenceEngine::Precision::UNSPECIFIED,
// deviceName
CommonTestUtils::DEVICE_CPU,
};
const auto SerializeEqualTestParams = ::testing::Combine(
::testing::ValuesIn(CommonTestUtils::combineParams(data.inputShapes)),
::testing::ValuesIn(data.inputsPrecisions),
::testing::Values(data.opType),
::testing::ValuesIn(data.secondInputTypes),
::testing::Values(data.ieInputPrecision),
::testing::Values(data.ieOutputPrecision),
::testing::Values(data.deviceName),
::testing::Values(data.additional_config));
INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs, ComparisonLayerTest, SerializeEqualTestParams, ComparisonLayerTest::getTestCaseName);
} // namespace

View File

@@ -0,0 +1,63 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "comparison_ops.hpp"
using namespace LayerTestsDefinitions;
using namespace LayerTestsDefinitions::ComparisonParams;
namespace {
TEST_P(ComparisonLayerTest, Serialize) {
Serialize();
}
ComparisionOpsData data = {
// inputsShape
{
{{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}}},
{{1, 3, 20}, {{20}, {2, 1, 1}}},
{{2, 17, 3, 4}, {{4}, {1, 3, 4}, {2, 1, 3, 4}}},
{{2, 17, 3, 4}, {{4}, {1, 3, 4}, {141, 1, 3, 4}}},
{{2, 1, 1, 3, 1}, {{1}, {1, 3, 4}, {2, 1, 3, 4}, {1, 1, 1, 1, 1}}},
},
// inputsPrecisions
{
InferenceEngine::Precision::FP64,
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
InferenceEngine::Precision::I32,
InferenceEngine::Precision::U32,
InferenceEngine::Precision::BOOL,
},
// secondIinputsType
{
ngraph::helpers::InputLayerType::CONSTANT,
ngraph::helpers::InputLayerType::PARAMETER,
},
// additionalConfig
{},
// opType
ngraph::helpers::ComparisonTypes::GREATER,
// ieInputPrecision
InferenceEngine::Precision::UNSPECIFIED,
// ieOutputPrecision
InferenceEngine::Precision::UNSPECIFIED,
// deviceName
CommonTestUtils::DEVICE_CPU,
};
const auto SerializeGreaterTestParams = ::testing::Combine(
::testing::ValuesIn(CommonTestUtils::combineParams(data.inputShapes)),
::testing::ValuesIn(data.inputsPrecisions),
::testing::Values(data.opType),
::testing::ValuesIn(data.secondInputTypes),
::testing::Values(data.ieInputPrecision),
::testing::Values(data.ieOutputPrecision),
::testing::Values(data.deviceName),
::testing::Values(data.additional_config));
INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs, ComparisonLayerTest, SerializeGreaterTestParams, ComparisonLayerTest::getTestCaseName);
} // namespace

View File

@@ -0,0 +1,63 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "comparison_ops.hpp"
using namespace LayerTestsDefinitions;
using namespace LayerTestsDefinitions::ComparisonParams;
namespace {
TEST_P(ComparisonLayerTest, Serialize) {
Serialize();
}
ComparisionOpsData data = {
// inputsShape
{
{{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}}},
{{1, 3, 20}, {{20}, {2, 1, 1}}},
{{2, 17, 3, 4}, {{4}, {1, 3, 4}, {2, 1, 3, 4}}},
{{2, 17, 3, 4}, {{4}, {1, 3, 4}, {141, 1, 3, 4}}},
{{2, 1, 1, 3, 1}, {{1}, {1, 3, 4}, {2, 1, 3, 4}, {1, 1, 1, 1, 1}}},
},
// inputsPrecisions
{
InferenceEngine::Precision::FP64,
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
InferenceEngine::Precision::I32,
InferenceEngine::Precision::U32,
InferenceEngine::Precision::BOOL,
},
// secondIinputsType
{
ngraph::helpers::InputLayerType::CONSTANT,
ngraph::helpers::InputLayerType::PARAMETER,
},
// additionalConfig
{},
// opType
ngraph::helpers::ComparisonTypes::GREATER_EQUAL,
// ieInputPrecision
InferenceEngine::Precision::UNSPECIFIED,
// ieOutputPrecision
InferenceEngine::Precision::UNSPECIFIED,
// deviceName
CommonTestUtils::DEVICE_CPU,
};
const auto SerializeGreaterEqualTestParams = ::testing::Combine(
::testing::ValuesIn(CommonTestUtils::combineParams(data.inputShapes)),
::testing::ValuesIn(data.inputsPrecisions),
::testing::Values(data.opType),
::testing::ValuesIn(data.secondInputTypes),
::testing::Values(data.ieInputPrecision),
::testing::Values(data.ieOutputPrecision),
::testing::Values(data.deviceName),
::testing::Values(data.additional_config));
INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs, ComparisonLayerTest, SerializeGreaterEqualTestParams, ComparisonLayerTest::getTestCaseName);
} // namespace

View File

@@ -0,0 +1,63 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "comparison_ops.hpp"
using namespace LayerTestsDefinitions;
using namespace LayerTestsDefinitions::ComparisonParams;
namespace {
TEST_P(ComparisonLayerTest, Serialize) {
Serialize();
}
ComparisionOpsData data = {
// inputsShape
{
{{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}}},
{{1, 3, 20}, {{20}, {2, 1, 1}}},
{{2, 17, 3, 4}, {{4}, {1, 3, 4}, {2, 1, 3, 4}}},
{{2, 17, 3, 4}, {{4}, {1, 3, 4}, {141, 1, 3, 4}}},
{{2, 1, 1, 3, 1}, {{1}, {1, 3, 4}, {2, 1, 3, 4}, {1, 1, 1, 1, 1}}},
},
// inputsPrecisions
{
InferenceEngine::Precision::FP64,
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
InferenceEngine::Precision::I32,
InferenceEngine::Precision::U32,
InferenceEngine::Precision::BOOL,
},
// secondIinputsType
{
ngraph::helpers::InputLayerType::CONSTANT,
ngraph::helpers::InputLayerType::PARAMETER,
},
// additionalConfig
{},
// opType
ngraph::helpers::ComparisonTypes::LESS,
// ieInputPrecision
InferenceEngine::Precision::UNSPECIFIED,
// ieOutputPrecision
InferenceEngine::Precision::UNSPECIFIED,
// deviceName
CommonTestUtils::DEVICE_CPU,
};
const auto SerializeLessTestParams = ::testing::Combine(
::testing::ValuesIn(CommonTestUtils::combineParams(data.inputShapes)),
::testing::ValuesIn(data.inputsPrecisions),
::testing::Values(data.opType),
::testing::ValuesIn(data.secondInputTypes),
::testing::Values(data.ieInputPrecision),
::testing::Values(data.ieOutputPrecision),
::testing::Values(data.deviceName),
::testing::Values(data.additional_config));
INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs, ComparisonLayerTest, SerializeLessTestParams, ComparisonLayerTest::getTestCaseName);
} // namespace

View File

@@ -0,0 +1,63 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "comparison_ops.hpp"
using namespace LayerTestsDefinitions;
using namespace LayerTestsDefinitions::ComparisonParams;
namespace {
TEST_P(ComparisonLayerTest, Serialize) {
Serialize();
}
ComparisionOpsData data = {
// inputsShape
{
{{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}}},
{{1, 3, 20}, {{20}, {2, 1, 1}}},
{{2, 17, 3, 4}, {{4}, {1, 3, 4}, {2, 1, 3, 4}}},
{{2, 17, 3, 4}, {{4}, {1, 3, 4}, {141, 1, 3, 4}}},
{{2, 1, 1, 3, 1}, {{1}, {1, 3, 4}, {2, 1, 3, 4}, {1, 1, 1, 1, 1}}},
},
// inputsPrecisions
{
InferenceEngine::Precision::FP64,
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
InferenceEngine::Precision::I32,
InferenceEngine::Precision::U32,
InferenceEngine::Precision::BOOL,
},
// secondIinputsType
{
ngraph::helpers::InputLayerType::CONSTANT,
ngraph::helpers::InputLayerType::PARAMETER,
},
// additionalConfig
{},
// opType
ngraph::helpers::ComparisonTypes::LESS_EQUAL,
// ieInputPrecision
InferenceEngine::Precision::UNSPECIFIED,
// ieOutputPrecision
InferenceEngine::Precision::UNSPECIFIED,
// deviceName
CommonTestUtils::DEVICE_CPU,
};
const auto SerializeLessEqualTestParams = ::testing::Combine(
::testing::ValuesIn(CommonTestUtils::combineParams(data.inputShapes)),
::testing::ValuesIn(data.inputsPrecisions),
::testing::Values(data.opType),
::testing::ValuesIn(data.secondInputTypes),
::testing::Values(data.ieInputPrecision),
::testing::Values(data.ieOutputPrecision),
::testing::Values(data.deviceName),
::testing::Values(data.additional_config));
INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs, ComparisonLayerTest, SerializeLessEqualTestParams, ComparisonLayerTest::getTestCaseName);
} // namespace

View File

@@ -0,0 +1,63 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "comparison_ops.hpp"
using namespace LayerTestsDefinitions;
using namespace LayerTestsDefinitions::ComparisonParams;
namespace {
TEST_P(ComparisonLayerTest, Serialize) {
Serialize();
}
ComparisionOpsData data = {
// inputsShape
{
{{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}}},
{{1, 3, 20}, {{20}, {2, 1, 1}}},
{{2, 17, 3, 4}, {{4}, {1, 3, 4}, {2, 1, 3, 4}}},
{{2, 17, 3, 4}, {{4}, {1, 3, 4}, {141, 1, 3, 4}}},
{{2, 1, 1, 3, 1}, {{1}, {1, 3, 4}, {2, 1, 3, 4}, {1, 1, 1, 1, 1}}},
},
// inputsPrecisions
{
InferenceEngine::Precision::FP64,
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
InferenceEngine::Precision::I32,
InferenceEngine::Precision::U32,
InferenceEngine::Precision::BOOL,
},
// secondIinputsType
{
ngraph::helpers::InputLayerType::CONSTANT,
ngraph::helpers::InputLayerType::PARAMETER,
},
// additionalConfig
{},
// opType
ngraph::helpers::ComparisonTypes::NOT_EQUAL,
// ieInputPrecision
InferenceEngine::Precision::UNSPECIFIED,
// ieOutputPrecision
InferenceEngine::Precision::UNSPECIFIED,
// deviceName
CommonTestUtils::DEVICE_CPU,
};
const auto SerializeNotEqualTestParams = ::testing::Combine(
::testing::ValuesIn(CommonTestUtils::combineParams(data.inputShapes)),
::testing::ValuesIn(data.inputsPrecisions),
::testing::Values(data.opType),
::testing::ValuesIn(data.secondInputTypes),
::testing::Values(data.ieInputPrecision),
::testing::Values(data.ieOutputPrecision),
::testing::Values(data.deviceName),
::testing::Values(data.additional_config));
INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs, ComparisonLayerTest, SerializeNotEqualTestParams, ComparisonLayerTest::getTestCaseName);
} // namespace

View File

@@ -22,6 +22,9 @@ std::map<std::vector<size_t>, std::vector<std::vector<size_t>>> inputShapes = {
std::vector<InferenceEngine::Precision> inputsPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
InferenceEngine::Precision::I32,
InferenceEngine::Precision::BOOL,
};
std::vector<ngraph::helpers::ComparisonTypes> comparisonOpTypes = {

View File

@@ -31,6 +31,7 @@ VERIFIED_OP_REFERENCES = [
'DepthToSpace-1',
'DetectionOutput-1',
'Divide-1',
'Equal-1',
'Erf-1',
'ExperimentalDetectronDetectionOutput-6',
'ExperimentalDetectronGenerateProposalsSingleImage-6',

View File

@@ -475,7 +475,6 @@ set(MULTI_TEST_SRC
backend/normalize_l2.in.cpp
backend/non_max_suppression.in.cpp
backend/non_zero.in.cpp
backend/numeric.in.cpp
backend/one_hot.in.cpp
backend/pad.in.cpp
backend/parameter_as_output.in.cpp

View File

@@ -1,65 +0,0 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "gtest/gtest.h"
#include "ngraph/ngraph.hpp"
#include "util/engine/test_engines.hpp"
#include "util/test_case.hpp"
#include "util/test_control.hpp"
NGRAPH_SUPPRESS_DEPRECATED_START
using namespace std;
using namespace ngraph;
static string s_manifest = "${MANIFEST}";
using TestEngine = test::ENGINE_CLASS_NAME(${BACKEND_NAME});
NGRAPH_TEST(${BACKEND_NAME}, numeric_float_nan)
{
Shape shape{5};
auto A = op::Constant::create(element::f32, shape, {-2.5f, 25.5f, 2.25f, NAN, 6.0f});
auto B = op::Constant::create(element::f32, shape, {10.0f, 5.0f, 2.25f, 10.0f, NAN});
auto f = make_shared<Function>(make_shared<op::v1::Equal>(A, B), ParameterVector{});
auto test_case = test::TestCase<TestEngine>(f);
test_case.add_expected_output<bool>(shape, {false, false, true, false, false});
test_case.run();
}
NGRAPH_TEST(${BACKEND_NAME}, numeric_double_nan)
{
Shape shape{5};
auto A = op::Constant::create(element::f64, shape, {-2.5f, 25.5f, 2.25f, NAN, 6.0f});
auto B = op::Constant::create(element::f64, shape, {10.0f, 5.0f, 2.25f, 10.0f, NAN});
auto f = make_shared<Function>(make_shared<op::v1::Equal>(A, B), ParameterVector{});
auto test_case = test::TestCase<TestEngine>(f);
test_case.add_expected_output<bool>(shape, {false, false, true, false, false});
test_case.run();
}
NGRAPH_TEST(${BACKEND_NAME}, numeric_float_inf)
{
Shape shape{5};
auto A = op::Constant::create(element::f32, shape, {-2.5f, 25.5f, 2.25f, INFINITY, 6.0f});
auto B = op::Constant::create(element::f32, shape, {10.0f, 5.0f, 2.25f, 10.0f, -INFINITY});
auto f = make_shared<Function>(make_shared<op::v1::Equal>(A, B), ParameterVector{});
auto test_case = test::TestCase<TestEngine>(f);
test_case.add_expected_output<bool>(shape, {false, false, true, false, false});
test_case.run();
}
NGRAPH_TEST(${BACKEND_NAME}, numeric_double_inf)
{
Shape shape{5};
auto A = op::Constant::create(element::f64, shape, {-2.5f, 25.5f, 2.25f, INFINITY, 6.0f});
auto B = op::Constant::create(element::f64, shape, {10.0f, 5.0f, 2.25f, 10.0f, -INFINITY});
auto f = make_shared<Function>(make_shared<op::v1::Equal>(A, B), ParameterVector{});
auto test_case = test::TestCase<TestEngine>(f);
test_case.add_expected_output<bool>(shape, {false, false, true, false, false});
test_case.run();
}

View File

@@ -248,10 +248,6 @@ onnx_size_op_graph_middle
shape_of_vector
shape_of_matrix
shape_of_5d
numeric_float_nan
numeric_float_inf
numeric_double_nan
numeric_double_inf
fake_quantize_pdpd
IE_GPU.fake_quantize
@@ -421,7 +417,6 @@ max_pool_2d_1channel_1image_overpadded
grn_2d_with_bias
erf
divide_adjoint_stability
equal
notequal
greater
greatereq