Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/ggml/blob/master/src/ggml-openvino/openvino/op/concat.cpp # ggml [Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `ggml / src / ggml-openvino / openvino / op / concat.cpp` 48 lines ยท 1647 bytes Raw Blame History 1 #include "../node_context.h" 2 #include "../op_table.h" 3 #include "../utils.h" 4 5 #include 6 #include 7 #include 8 #include 9 10 namespace ov { 11 namespace frontend { 12 namespace ggml { 13 namespace op { 14 15 OutputVector translate_concat(const NodeContext & context) { 16 num_inputs_check(context, 2, 2); 17 18 const int32_t * op_params = context.get_output_op_params(); 19 FRONT_END_CHECK_IMPLEMENTED(op_params != nullptr, "CONCAT requires output op params"); 20 21 const auto output_shape = context.get_output_shape(); 22 FRONT_END_CHECK_IMPLEMENTED(output_shape.rank().is_static(), "CONCAT requires static output rank"); 23 24 const auto rank = output_shape.rank().get_length(); 25 const int32_t ggml_dim = op_params[0]; 26 FRONT_END_CHECK_IMPLEMENTED(ggml_dim >= 0 && ggml_dim < rank, "CONCAT axis is out of range"); 27 28 auto input_0 = process_view_input_new(context, 0); 29 auto input_1 = process_view_input_new(context, 1); 30 const auto output_type = context.get_output_type(); 31 32 if (input_0.get_element_type() != output_type) { 33 input_0 = std::make_shared(input_0, output_type); 34 } 35 if (input_1.get_element_type() != output_type) { 36 input_1 = std::make_shared(input_1, output_type); 37 } 38 39 const auto axis = static_cast(rank - 1 - ggml_dim); 40 auto res = std::make_shared(OutputVector{input_0, input_1}, axis); 41 42 return rename_outputs_with_suffix({res}, context.get_name()); 43 } 44 45 } // namespace op 46 } // namespace ggml 47 } // namespace frontend 48 } // namespace ov