char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
511f9c137
char/aliceai-t5-moe
1#include "../node_context.h" 2#include "../op_table.h" 3#include "../utils.h" 4 5#include <openvino/op/avg_pool.hpp> 6#include <openvino/op/max_pool.hpp> 7#include <openvino/op/convert.hpp> 8 9namespace ov { 10namespace frontend { 11namespace ggml { 12namespace op { 13 14OutputVector translate_pool_2d (const NodeContext & context ) { 15num_inputs_check (context ,1 ,1 ); 16const int32_t * params = context .get_output_op_params (); 17 18const int k0 = params [1 ]; 19const int k1 = params [2 ]; 20const int s0 = params [3 ]; 21const int s1 = params [4 ]; 22const int p0 = params [5 ]; 23const int p1 = params [6 ]; 24 25const int op_case = context .get_op_case (); 26 ov::Output < Node > input = context .get_input (0 ); 27 ov::Strides strides {static_cast < size_t > (s1 ),static_cast < size_t > (s0 )}; 28 ov::Shape pads_begin {static_cast < size_t > (p1 ),static_cast < size_t > (p0 )}; 29 ov::Shape pads_end {static_cast < size_t > (p1 ),static_cast < size_t > (p0 )}; 30 ov::Shape kernel {static_cast < size_t > (k1 ),static_cast < size_t > (k0 )}; 31 ov::Output < Node > res ; 32 33switch (op_case ) { 34case 1 :// GGML_OP_POOL_MAX 35 { 36res = std::make_shared < ov::op::v1::MaxPool > (input ,strides ,pads_begin ,pads_end ,kernel ); 37break ; 38 } 39case 2 :// GGML_OP_POOL_AVG 40 { 41res = std::make_shared < ov::op::v1::AvgPool > (input ,strides ,pads_begin ,pads_end ,kernel , false); 42break ; 43 } 44default : 45break ; 46 } 47return rename_outputs_with_suffix ({res },context .get_name ()); 48} 49 50}// namespace op 51}// namespace ggml 52}// namespace frontend 53}// namespace ov