-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 less equal #6720
Merged
Merged
Revise less equal #6720
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
07a9c3d
update spec, add visitors, backend test
bszmelcz 536feda
Merge remote-tracking branch 'upstream/master' into revise_less_equal
bszmelcz ed69b32
remove visitors test as it is implemented in another PR
bszmelcz bc5727c
Merge remote-tracking branch 'upstream/master' into revise_less_equal
bszmelcz 08ccab8
remove visitors test from CMakeLists
bszmelcz c61eb41
remove old backend tests, refactor minor parts of the code
bszmelcz 9feca95
Merge remote-tracking branch 'upstream/master' into revise_less_equal
bszmelcz 841a75f
add namespace
bszmelcz 653f4d0
resolve conflicts
bszmelcz 1331344
refaactor template test for less_equal op
bszmelcz db3d0a5
Merge remote-tracking branch 'upstream/master' into revise_less_equal
bszmelcz 2906df7
Merge remote-tracking branch 'upstream/master' into revise_less_equal
bszmelcz 7e2d0d6
update spec
bszmelcz b7815ed
Merge remote-tracking branch 'upstream/master' into revise_less_equal
bszmelcz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
docs/template_plugin/tests/functional/op_reference/less_eq.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// Copyright (C) 2018-2021 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include <gtest/gtest.h> | ||
|
||
#include <ie_core.hpp> | ||
#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 { | ||
namespace ComparisonOpsRefTestDefinitions { | ||
namespace { | ||
TEST_P(ReferenceComparisonLayerTest, LessEqualCompareWithHardcodedRefs) { | ||
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 { | ||
// 1D // 2D // 3D // 4D | ||
Builder {} | ||
.compType(ComparisonTypes::LESS_EQUAL) | ||
.input1({{2, 2}, type, std::vector<T> {0, 12, 23, 0}}) | ||
.input2({{2, 2}, type, std::vector<T> {0, 12, 23, 0}}) | ||
.expected({{2, 2}, element::boolean, std::vector<char> {1, 1, 1, 1}}), | ||
Builder {} | ||
.compType(ComparisonTypes::LESS_EQUAL) | ||
.input1({{2, 3}, type, std::vector<T> {0, 6, 45, 1, 21, 21}}) | ||
.input2({{2, 3}, type, std::vector<T> {1, 18, 23, 1, 19, 21}}) | ||
.expected({{2, 3}, element::boolean, std::vector<char> {1, 1, 0, 1, 0, 1}}), | ||
Builder {} | ||
.compType(ComparisonTypes::LESS_EQUAL) | ||
.input1({{1}, type, std::vector<T> {53}}) | ||
.input2({{1}, type, std::vector<T> {53}}) | ||
.expected({{1}, element::boolean, std::vector<char> {1}}), | ||
Builder {} | ||
.compType(ComparisonTypes::LESS_EQUAL) | ||
.input1({{2, 4}, type, std::vector<T> {0, 12, 23, 0, 1, 5, 11, 8}}) | ||
.input2({{2, 4}, type, std::vector<T> {0, 12, 23, 0, 10, 5, 11, 8}}) | ||
.expected({{2, 4}, element::boolean, std::vector<char> {1, 1, 1, 1, 1, 1, 1, 1}}), | ||
Builder {} | ||
.compType(ComparisonTypes::LESS_EQUAL) | ||
.input1({{3, 1, 2}, type, std::vector<T> {2, 1, 4, 1, 3, 1}}) | ||
.input2({{1, 2, 1}, type, std::vector<T> {1, 1}}) | ||
.expected({{3, 2, 2}, element::boolean, std::vector<char> {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1}}), | ||
Builder {} | ||
.compType(ComparisonTypes::LESS_EQUAL) | ||
.input1({{2, 1, 2, 1}, type, std::vector<T> {2, 1, 4, 1}}) | ||
.input2({{1, 2, 1}, type, std::vector<T> {1, 1}}) | ||
.expected({{2, 1, 2, 1}, element::boolean, std::vector<char> {0, 1, 0, 1}})}; | ||
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::u32>(element::u32), | ||
generateComparisonParams<element::Type_t::u8>(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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ | |
'HardSigmoid-1', | ||
'Interpolate-4', | ||
'Less-1', | ||
'LessEqual-1' | ||
'LRN-1', | ||
'LSTMCell-4', | ||
'LSTMSequence-5', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove word "multi-directional"