Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise NotEqual #7198

Merged
merged 35 commits into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
42bcf6b
Hiding the problem, Validate() changes 'function'
nsemaev May 28, 2021
c823204
Merge branch 'openvinotoolkit:master' into master
nsemaev May 31, 2021
4383327
Merge branch 'openvinotoolkit:master' into master
nsemaev Jun 1, 2021
37f9da7
Merge branch 'openvinotoolkit:master' into master
nsemaev Jun 3, 2021
2b451dd
Merge branch 'openvinotoolkit:master' into master
nsemaev Jun 15, 2021
1fcdd56
Merge branch 'openvinotoolkit:master' into master
nsemaev Jun 22, 2021
cff4fbe
Merge branch 'openvinotoolkit:master' into master
nsemaev Jun 22, 2021
70a1986
Merge branch 'openvinotoolkit:master' into master
nsemaev Jun 23, 2021
6892756
Merge branch 'openvinotoolkit:master' into master
nsemaev Jun 23, 2021
68cc73d
Merge branch 'openvinotoolkit:master' into master
nsemaev Jul 26, 2021
eefe48f
Merge branch 'openvinotoolkit:master' into master
nsemaev Jul 26, 2021
03aa9f5
Template plugin tests
nsemaev Aug 23, 2021
c5386b9
Undo the changes that are not necessary
nsemaev Aug 24, 2021
150fac1
Align code style
nsemaev Aug 25, 2021
a4e3309
Added \n at end of file
nsemaev Aug 25, 2021
65dd1e2
Merge branch 'openvinotoolkit:master' into notequal
nsemaev Aug 25, 2021
dcd0970
Removing an unused implementation
nsemaev Aug 27, 2021
d36204f
Merge branch 'openvinotoolkit:master' into notequal
nsemaev Aug 30, 2021
ecc1a10
Merge branch 'openvinotoolkit:master' into notequal
nsemaev Aug 30, 2021
6dbe3be
Merge branch 'openvinotoolkit:master' into notequal
nsemaev Aug 31, 2021
cc48e90
New version with Code Style checking
nsemaev Aug 31, 2021
f1636b6
Cleaning backend tests
nsemaev Aug 31, 2021
31d7400
Merge branch 'openvinotoolkit:master' into notequal
nsemaev Aug 31, 2021
7e868e3
Merge branch 'openvinotoolkit:master' into notequal
nsemaev Sep 2, 2021
185ae1d
Reworked the tests the right way
nsemaev Sep 3, 2021
90285b9
Removed visit_attributes()
nsemaev Sep 3, 2021
daa56ff
Removed visit_attributes() in source file
nsemaev Sep 3, 2021
112d0eb
Added NGRAPH_CHECK macros to evaluate()
nsemaev Sep 3, 2021
73a70ed
Removed zero_sized_not_equal mention from unit_test.manifest
nsemaev Sep 3, 2021
5b74780
Added function name to the constants.py
nsemaev Sep 3, 2021
3f169c7
Revert "Added function name to the constants.py"
nsemaev Sep 3, 2021
21ca033
Merge branch 'openvinotoolkit:master' into notequal
nsemaev Sep 3, 2021
64a241e
Resolving a merge conflict
nsemaev Sep 7, 2021
cbd8248
Return visit_attributes() for op::v1::NotEqual due to NotEqual being …
nsemaev Sep 7, 2021
5b28d6b
Merge branch 'openvinotoolkit:master' into notequal
nsemaev Sep 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions docs/template_plugin/tests/functional/op_reference/notequal.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#include <gtest/gtest.h>

#include <ie_core.hpp>
nsemaev marked this conversation as resolved.
Show resolved Hide resolved
#include <ie_ngraph_utils.hpp>
#include <ngraph/ngraph.hpp>
#include <shared_test_classes/base/layer_test_utils.hpp>

#include "comparison.hpp"

using namespace ngraph;
using namespace InferenceEngine;
using ComparisonTypes = ngraph::helpers::ComparisonTypes;

namespace reference_tests {
nsemaev marked this conversation as resolved.
Show resolved Hide resolved
namespace ComparisonOpsRefTestDefinitions {
namespace {
TEST_P(ReferenceComparisonLayerTest, GreaterCompareWithHardcodedRefs) {
Exec();
}

template <element::Type_t IN_ET>
std::vector<RefComparisonParams> generateComparisonParams(const element::Type& type) {
using T = typename element_type_traits<IN_ET>::value_type;
std::vector<RefComparisonParams> compParams {
Builder {}
.compType(ComparisonTypes::NOT_EQUAL)
.input1({{2, 2}, type, std::vector<T> {1, 0, 10, 999}})
.input2({{2, 2}, type, std::vector<T> {1, 0, 10, 999}})
.expected({{2, 2}, element::boolean, std::vector<char> {0, 0, 0, 0}}),
Builder {}
.compType(ComparisonTypes::NOT_EQUAL)
.input1({{2, 3}, type, std::vector<T> {0, 15, 45, 10, 5, 10}})
.input2({{2, 3}, type, std::vector<T> {1, 15, -45, 10, 50, 10}})
.expected({{2, 3}, element::boolean, std::vector<char> {1, 0, 1, 0, 1, 0}}),
Builder {}
.compType(ComparisonTypes::NOT_EQUAL)
.input1({{1}, type, std::vector<T> {23}})
.input2({{1}, type, std::vector<T> {23}})
.expected({{1}, element::boolean, std::vector<char> {0}}),
Builder {}
.compType(ComparisonTypes::NOT_EQUAL)
.input1({{1}, type, std::vector<T> {20}})
.input2({{1}, type, std::vector<T> {10}})
.expected({{1}, element::boolean, std::vector<char> {1}}),
Builder {}
.compType(ComparisonTypes::NOT_EQUAL)
.input1({{2, 4}, type, std::vector<T> {0, 12, 23, 0, 1, 5, 12, 8}})
.input2({{2, 4}, type, std::vector<T> {0, 12, 23, 0, 10, 5, 11, 8}})
.expected({{2, 4}, element::boolean, std::vector<char> {0, 0, 0, 0, 1, 0, 1, 0}});
return compParams;
}

std::vector<RefComparisonParams> generateComparisonCombinedParams() {
const std::vector<std::vector<RefComparisonParams>> compTypeParams {
generateComparisonParams<element::Type_t::f32>(element::f32),
generateComparisonParams<element::Type_t::f16>(element::f16),
generateComparisonParams<element::Type_t::i32>(element::i32),
generateComparisonParams<element::Type_t::i64>(element::i64),
generateComparisonParams<element::Type_t::u32>(element::u32),
generateComparisonParams<element::Type_t::u64>(element::u64),
generateComparisonParams<element::Type_t::boolean>(element::boolean)};
std::vector<RefComparisonParams> combinedParams;

for (const auto& params : compTypeParams) {
combinedParams.insert(combinedParams.end(), params.begin(), params.end());
}
return combinedParams;
}

} // namespace
INSTANTIATE_TEST_SUITE_P(smoke_Comparison_With_Hardcoded_Refs, ReferenceComparisonLayerTest, ::testing::ValuesIn(generateComparisonCombinedParams()),
ReferenceComparisonLayerTest::getTestCaseName);
} // namespace ComparisonOpsRefTestDefinitions
} // namespace reference_tests
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,22 @@ void LayerTestsCommon::Run() {
s.updateOPsStats(function, PassRate::Statuses::CRASHED);
}

auto function_ = function;
nsemaev marked this conversation as resolved.
Show resolved Hide resolved
try {
LoadNetwork();
GenerateInputs();
Infer();
Validate();
s.updateOPsStats(function, PassRate::Statuses::PASSED);
s.updateOPsStats(function_, PassRate::Statuses::PASSED);
}
catch (const std::runtime_error &re) {
s.updateOPsStats(function, PassRate::Statuses::FAILED);
s.updateOPsStats(function_, PassRate::Statuses::FAILED);
GTEST_FATAL_FAILURE_(re.what());
} catch (const std::exception &ex) {
s.updateOPsStats(function, PassRate::Statuses::FAILED);
s.updateOPsStats(function_, PassRate::Statuses::FAILED);
GTEST_FATAL_FAILURE_(ex.what());
} catch (...) {
s.updateOPsStats(function, PassRate::Statuses::FAILED);
s.updateOPsStats(function_, PassRate::Statuses::FAILED);
GTEST_FATAL_FAILURE_("Unknown failure occurred.");
}
}
Expand Down