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

Function ggml_set_impl

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

Source from the content-addressed store, hash-verified

3322// ggml_set
3323
3324static struct ggml_tensor * ggml_set_impl(
3325 struct ggml_context * ctx,
3326 struct ggml_tensor * a,
3327 struct ggml_tensor * b,
3328 size_t nb1,
3329 size_t nb2,
3330 size_t nb3,
3331 size_t offset,
3332 bool inplace) {
3333 GGML_ASSERT(ggml_nelements(a) >= ggml_nelements(b));
3334
3335 // make a view of the destination
3336 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
3337
3338 GGML_ASSERT(offset < (size_t)(1 << 30));
3339 int32_t params[] = { nb1, nb2, nb3, offset, inplace ? 1 : 0 };
3340 ggml_set_op_params(result, params, sizeof(params));
3341
3342 result->op = GGML_OP_SET;
3343 result->src[0] = a;
3344 result->src[1] = b;
3345
3346 return result;
3347}
3348
3349struct ggml_tensor * ggml_set(
3350 struct ggml_context * ctx,

Callers 6

ggml_setFunction · 0.85
ggml_set_inplaceFunction · 0.85
ggml_set_1dFunction · 0.85
ggml_set_1d_inplaceFunction · 0.85
ggml_set_2dFunction · 0.85
ggml_set_2d_inplaceFunction · 0.85

Calls 4

ggml_nelementsFunction · 0.85
ggml_view_tensorFunction · 0.85
ggml_dup_tensorFunction · 0.85
ggml_set_op_paramsFunction · 0.85

Tested by

no test coverage detected