-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
Copy pathgather.cpp
31 lines (26 loc) · 946 Bytes
/
gather.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (C) 2018-2025 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "openvino/op/gather.hpp"
#include "core/operator_set.hpp"
#include "openvino/op/constant.hpp"
namespace ov {
namespace frontend {
namespace onnx {
namespace ai_onnx {
namespace opset_1 {
ov::OutputVector gather(const ov::frontend::onnx::Node& node) {
ov::OutputVector ng_inputs{node.get_ov_inputs()};
auto data = ng_inputs.at(0);
auto indices = ng_inputs.at(1);
auto axis = node.get_attribute_value<int64_t>("axis", 0);
return {std::make_shared<ov::op::v8::Gather>(data,
indices,
ov::op::v0::Constant::create(ov::element::i64, ov::Shape{}, {axis}))};
}
ONNX_OP("Gather", OPSET_SINCE(1), ai_onnx::opset_1::gather);
} // namespace opset_1
} // namespace ai_onnx
} // namespace onnx
} // namespace frontend
} // namespace ov