#include #include #include #include #include #include #include #include #include #include "../node_context.hpp" #include "../op_table.hpp" #include "../utils.hpp" namespace ov { namespace frontend { namespace ggml { namespace op { OutputVector translate_get_rows(const NodeContext& context) { num_inputs_check(context, 2, 2); int op_case = context.get_op_case(); FRONT_END_CHECK_IMPLEMENTED(op_case == 1 || op_case == 2, "Unsupported CONT case"); Output res; auto data = context.get_input(0); auto indices = context.get_input(1); if (op_case == 2) { // The input comes from a VIEW indices = process_view_input(context, 1); } auto axis = ov::op::v0::Constant::create(ov::element::i32, ov::Shape{}, {1}); if (indices.get_partial_shape()[1].get_length() == 1) { indices = std::make_shared(indices, ov::op::v0::Constant::create(ov::element::i64, {2}, {0, 1})); res = std::make_shared(data, indices, axis); } else { indices = std::make_shared(indices, ov::op::v0::Constant::create(ov::element::i64, {1}, {0})); res = std::make_shared(data, indices, axis, 1); } if (res.get_element_type() != context.get_output_type(0)) { res = std::make_shared(res, context.get_output_type(0)); } return rename_outputs_with_suffix({res}, context.get_name()); } } // namespace op } // namespace ggml } // namespace frontend } // namespace ov