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/pool_2d.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 / pool_2d.cpp` 53 lines ยท 1553 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 9 namespace ov { 10 namespace frontend { 11 namespace ggml { 12 namespace op { 13 14 OutputVector translate_pool_2d(const NodeContext & context) { 15 num_inputs_check(context, 1, 1); 16 const int32_t * params = context.get_output_op_params(); 17 18 const int k0 = params[1]; 19 const int k1 = params[2]; 20 const int s0 = params[3]; 21 const int s1 = params[4]; 22 const int p0 = params[5]; 23 const int p1 = params[6]; 24 25 const int op_case = context.get_op_case(); 26 ov::Output input = context.get_input(0); 27 ov::Strides strides{static_cast(s1), static_cast(s0)}; 28 ov::Shape pads_begin{static_cast(p1), static_cast(p0)}; 29 ov::Shape pads_end{static_cast(p1), static_cast(p0)}; 30 ov::Shape kernel{static_cast(k1), static_cast(k0)}; 31 ov::Output res; 32 33 switch (op_case) { 34 case 1: // GGML_OP_POOL_MAX 35 { 36 res = std::make_shared(input, strides, pads_begin, pads_end, kernel); 37 break; 38 } 39 case 2: // GGML_OP_POOL_AVG 40 { 41 res = std::make_shared(input, strides, pads_begin, pads_end, kernel, false); 42 break; 43 } 44 default: 45 break; 46 } 47 return rename_outputs_with_suffix({res}, context.get_name()); 48 } 49 50 } // namespace op 51 } // namespace ggml 52 } // namespace frontend 53 } // namespace ov