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

Function ggml_scale_impl

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

Source from the content-addressed store, hash-verified

3271// ggml_scale
3272
3273static struct ggml_tensor * ggml_scale_impl(
3274 struct ggml_context * ctx,
3275 struct ggml_tensor * a,
3276 float s,
3277 float b,
3278 bool inplace) {
3279 GGML_ASSERT(ggml_is_padded_1d(a));
3280
3281 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
3282
3283 float params[2] = { s, b };
3284 ggml_set_op_params(result, &params, sizeof(params));
3285
3286 result->op = GGML_OP_SCALE;
3287 result->src[0] = a;
3288
3289 return result;
3290}
3291
3292struct ggml_tensor * ggml_scale(
3293 struct ggml_context * ctx,

Callers 5

ggml_scaleFunction · 0.85
ggml_scale_inplaceFunction · 0.85
ggml_scale_biasFunction · 0.85
ggml_scale_bias_inplaceFunction · 0.85
ggml_compute_backwardFunction · 0.85

Calls 4

ggml_is_padded_1dFunction · 0.85
ggml_view_tensorFunction · 0.85
ggml_dup_tensorFunction · 0.85
ggml_set_op_paramsFunction · 0.85

Tested by

no test coverage detected