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/fill.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 / fill.cpp` 34 lines ยท 1025 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 // GGML FILL sets all elements of a tensor to a constant value. 14 // The constant is stored as a float in op_params[0]. 15 OutputVector translate_fill(const NodeContext & context) { 16 num_inputs_check(context, 1, 1); 17 18 float c; 19 memcpy(&c, context.get_output_op_params(), sizeof(float)); 20 21 auto shape = context.get_input_shape(0).to_shape(); 22 23 auto val = ov::op::v0::Constant::create(context.get_output_type(), {}, {c}); 24 auto target_shape = ov::op::v0::Constant::create(ov::element::i64, {shape.size()}, 25 std::vector(shape.begin(), shape.end())); 26 auto res = std::make_shared(val, target_shape); 27 28 return rename_outputs_with_suffix({res}, context.get_name()); 29 } 30 31 } // namespace op 32 } // namespace ggml 33 } // namespace frontend 34 } // namespace ov