MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / ggml_fill_impl

Function ggml_fill_impl

subprojects/llama.cpp/ggml/src/ggml.c:5146–5162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5144// ggml_fill
5145
5146static struct ggml_tensor * ggml_fill_impl(
5147 struct ggml_context * ctx,
5148 struct ggml_tensor * a,
5149 float c,
5150 bool inplace) {
5151 GGML_ASSERT(a->type == GGML_TYPE_F32);
5152 GGML_ASSERT(ggml_is_contiguous(a));
5153
5154 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
5155
5156 ggml_set_op_params_f32(result, 0, c);
5157
5158 result->op = GGML_OP_FILL;
5159 result->src[0] = a;
5160
5161 return result;
5162}
5163
5164struct ggml_tensor * ggml_fill(
5165 struct ggml_context * ctx,

Callers 2

ggml_fillFunction · 0.85
ggml_fill_inplaceFunction · 0.85

Calls 4

ggml_is_contiguousFunction · 0.85
ggml_view_tensorFunction · 0.85
ggml_dup_tensorFunction · 0.85
ggml_set_op_params_f32Function · 0.85

Tested by

no test coverage detected