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/clamp.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 / clamp.cpp` 33 lines ยท 931 bytes Raw Blame History 1 #include "../node_context.h" 2 #include "../op_table.h" 3 #include "../utils.h" 4 5 #include 6 #include 7 8 namespace ov { 9 namespace frontend { 10 namespace ggml { 11 namespace op { 12 13 OutputVector translate_clamp(const NodeContext & context) { 14 num_inputs_check(context, 1, 1); 15 16 auto input = process_view_input_new(context, 0); 17 18 const int32_t * op_params = context.get_output_op_params(); 19 FRONT_END_CHECK_IMPLEMENTED(op_params != nullptr, "CLAMP requires output op params"); 20 21 float min; 22 float max; 23 std::memcpy(&min, reinterpret_cast(op_params) + 0, sizeof(float)); 24 std::memcpy(&max, reinterpret_cast(op_params) + 1, sizeof(float)); 25 26 auto res = std::make_shared(input, min, max); 27 return rename_outputs_with_suffix({res}, context.get_name()); 28 } 29 30 } // namespace op 31 } // namespace ggml 32 } // namespace frontend 33 } // namespace ov