ggml
[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)
Brought by drakestapleton
ggml / src / ggml-openvino / openvino / op / norm.cpp
| 1 | #include "../node_context.h" |
| 2 | #include "../op_table.h" |
| 3 | #include "../utils.h" |
| 4 | |
| 5 | #include <cstring> |
| 6 | #include <memory> |
| 7 | #include <openvino/op/constant.hpp> |
| 8 | #include <openvino/op/mvn.hpp> |
| 9 | |
| 10 | namespace ov { |
| 11 | namespace frontend { |
| 12 | namespace ggml { |
| 13 | namespace op { |
| 14 | |
| 15 | OutputVector translate_norm(const NodeContext & context) { |
| 16 | num_inputs_check(context, 1, 1); |
| 17 | |
| 18 | auto input_node = process_view_input_new(context, 0); |
| 19 | float eps; |
| 20 | memcpy(&eps, context.get_output_op_params(), sizeof(float)); |
| 21 | |
| 22 | auto axes = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{1}, {-1}); |
| 23 | auto res = std::make_shared<ov::op::v6::MVN>(input_node, axes, true, eps, ov::op::MVNEpsMode::INSIDE_SQRT); |
| 24 | |
| 25 | return rename_outputs_with_suffix({res}, context.get_name()); |
| 26 | } |
| 27 | |
| 28 | } // namespace op |
| 29 | } // namespace ggml |
| 30 | } // namespace frontend |
| 31 | } // namespace ov |