ggml
[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)
Brought by drakestapleton
ggml / src / ggml-openvino / openvino / op / cont.cpp
| 1 | |
| 2 | #include "../node_context.h" |
| 3 | #include "../op_table.h" |
| 4 | #include "../utils.h" |
| 5 | |
| 6 | #include <memory> |
| 7 | #include <openvino/op/reshape.hpp> |
| 8 | #include <openvino/op/slice.hpp> |
| 9 | |
| 10 | namespace ov { |
| 11 | namespace frontend { |
| 12 | namespace ggml { |
| 13 | namespace op { |
| 14 | |
| 15 | OutputVector translate_cont(const NodeContext & context) { |
| 16 | num_inputs_check(context, 1, 1); |
| 17 | |
| 18 | auto src_shape = context.get_input_shape(0).to_shape(); |
| 19 | auto dst_shape = context.get_output_shape().to_shape(); |
| 20 | |
| 21 | if (context.get_op_dynamic_dim() != -1) { |
| 22 | dst_shape[3 - context.get_op_dynamic_dim()] = -1; |
| 23 | } |
| 24 | |
| 25 | auto input = process_view_input_new(context, 0); |
| 26 | |
| 27 | ov::Output<Node> res; |
| 28 | res = std::make_shared<ov::op::v1::Reshape>( |
| 29 | input, ov::op::v0::Constant::create(ov::element::i64, {dst_shape.size()}, dst_shape), false); |
| 30 | |
| 31 | return rename_outputs_with_suffix({res}, context.get_name()); |
| 32 | } |
| 33 | |
| 34 | } // namespace op |
| 35 | } // namespace ggml |
| 36 | } // namespace frontend |
| 37 | } // namespace ov |