char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Zijun YuOpenVINO: Qwen3.5, memory optimization, and test-recurrent-state-rollback (#26952)aee56b3ab

char/aliceai-t5-moe
1016 B34 linesraw
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) {
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(ov::element::f32, {}, {c});
24    auto target_shape = ov::op::v0::Constant::create(ov::element::i64, {shape.size()},
25        std::vector<int64_t>(shape.begin(), shape.end()));
26    auto res = std::make_shared<ov::op::v3::Broadcast>(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