char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
890f1a27e
char/aliceai-t5-moe
1#include "../node_context.h" 2#include "../op_table.h" 3#include "../utils.h" 4 5#include <openvino/op/abs.hpp> 6#include <openvino/op/add.hpp> 7#include <openvino/op/constant.hpp> 8#include <openvino/op/exp.hpp> 9#include <openvino/op/log.hpp> 10#include <openvino/op/negative.hpp> 11#include <openvino/op/relu.hpp> 12 13namespace ov { 14namespace frontend { 15namespace ggml { 16namespace op { 17 18OutputVector translate_unary_softplus (const NodeContext & context ) { 19num_inputs_check (context ,1 ,1 ); 20 21auto input = process_view_input_new (context ,0 ); 22const auto element_type = input .get_element_type (); 23auto one = ov::op::v0::Constant ::create (element_type , ov::Shape {}, {1.0f }); 24 25auto positive = std::make_shared < ov::op::v0::Relu > (input ); 26auto abs = std::make_shared < ov::op::v0::Abs > (input ); 27auto neg_abs = std::make_shared < ov::op::v0::Negative > (abs ); 28auto exp_neg_abs = std::make_shared < ov::op::v0::Exp > (neg_abs ); 29auto log_term = std::make_shared < ov::op::v0::Log > (std::make_shared < ov::op::v1::Add > (one ,exp_neg_abs )); 30auto res = std::make_shared < ov::op::v1::Add > (positive ,log_term ); 31 32return rename_outputs_with_suffix ({res },context .get_name ()); 33} 34 35}// namespace op 36}// namespace ggml 37}// namespace frontend 38}// namespace ov