Skip to content

Commit 43018d2

Browse files
authored
Revert "Add stable parameter for topk" (#33646)
Reverts #33199 Ticket: 179141
1 parent 4db7053 commit 43018d2

File tree

3 files changed

+3
-104
lines changed

3 files changed

+3
-104
lines changed

src/frontends/onnx/frontend/src/op/topk.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ ov::OutputVector topk(const ov::frontend::onnx::Node& node) {
3838
axis,
3939
v11::TopK::Mode::MAX,
4040
v11::TopK::SortType::SORT_VALUES,
41-
ov::element::i64,
42-
true);
41+
ov::element::i64);
4342

4443
return {top_k->output(0), top_k->output(1)};
4544
}
@@ -57,8 +56,7 @@ ov::OutputVector topk(const ov::frontend::onnx::Node& node) {
5756
axis,
5857
v11::TopK::Mode::MAX,
5958
v11::TopK::SortType::SORT_VALUES,
60-
ov::element::i64,
61-
true);
59+
ov::element::i64);
6260

6361
return {top_k->output(0), top_k->output(1)};
6462
}
@@ -78,13 +76,11 @@ ov::OutputVector topk(const ov::frontend::onnx::Node& node) {
7876

7977
// Map attribute values to OpenVINO enums
8078
const auto sort_type = sorted ? v11::TopK::SortType::SORT_VALUES : v11::TopK::SortType::NONE;
81-
const auto stable_sort = (sort_type != v11::TopK::SortType::NONE);
8279

8380
const auto compute_max = static_cast<bool>(largest);
8481
const auto mode = compute_max ? v11::TopK::Mode::MAX : v11::TopK::Mode::MIN;
8582

86-
std::shared_ptr<ov::Node> top_k =
87-
std::make_shared<v11::TopK>(data, k, axis, mode, sort_type, ov::element::i64, stable_sort);
83+
std::shared_ptr<ov::Node> top_k = std::make_shared<v11::TopK>(data, k, axis, mode, sort_type, ov::element::i64);
8884

8985
return {top_k->output(0), top_k->output(1)};
9086
}

src/frontends/onnx/tests/models/top_3_all_same.prototxt

Lines changed: 0 additions & 85 deletions
This file was deleted.

src/frontends/onnx/tests/onnx_import.in.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2907,18 +2907,6 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_model_top_k_repeating_unsorted) {
29072907
test_case.run();
29082908
}
29092909

2910-
OPENVINO_TEST(${BACKEND_NAME}, onnx_model_top_3_all_same) {
2911-
auto model = convert_model("top_3_all_same.onnx");
2912-
2913-
auto test_case = ov::test::TestCase(model, s_device);
2914-
test_case.add_input<float>(Shape{2, 4}, {0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f});
2915-
test_case.add_input<int64_t>({3});
2916-
2917-
test_case.add_expected_output<float>(Shape{2, 3}, {0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f});
2918-
test_case.add_expected_output<int64_t>(Shape{2, 3}, {0, 1, 2, 0, 1, 2});
2919-
test_case.run();
2920-
}
2921-
29222910
OPENVINO_TEST(${BACKEND_NAME}, onnx_model_acosh) {
29232911
auto model = convert_model("acosh.onnx");
29242912

0 commit comments

Comments
 (0)