char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
aee56b3ab
char/aliceai-t5-moe
1#include "../node_context.h" 2#include "../op_table.h" 3#include "../utils.h" 4 5#include <openvino/op/broadcast.hpp> 6#include <openvino/op/constant.hpp> 7 8namespace ov { 9namespace frontend { 10namespace ggml { 11namespace op { 12 13// GGML FILL sets all elements of a tensor to a constant value. 14// The constant is stored as a float in op_params[0]. 15OutputVector translate_fill (const NodeContext & context ) { 16num_inputs_check (context ,1 ,1 ); 17 18float c ; 19memcpy (& c ,context .get_output_op_params (),sizeof (float )); 20 21auto shape = context .get_input_shape (0 ).to_shape (); 22 23auto val = ov::op::v0::Constant ::create (ov::element::f32 , {}, {c }); 24auto target_shape = ov::op::v0::Constant ::create (ov::element::i64 , {shape .size ()}, 25 std::vector < int64_t > (shape .begin (),shape .end ())); 26auto res = std::make_shared < ov::op::v3::Broadcast > (val ,target_shape ); 27 28return rename_outputs_with_suffix ({res },context .get_name ()); 29} 30 31}// namespace op 32}// namespace ggml 33}// namespace frontend 34}// namespace ov