MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_map_custom3_impl_f32

Function ggml_map_custom3_impl_f32

ggml.c:6074–6098  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6072// ggml_map_custom3_f32
6073
6074static struct ggml_tensor * ggml_map_custom3_impl_f32(
6075 struct ggml_context * ctx,
6076 struct ggml_tensor * a,
6077 struct ggml_tensor * b,
6078 struct ggml_tensor * c,
6079 const ggml_custom3_op_f32_t fun,
6080 bool inplace) {
6081 bool is_node = false;
6082
6083 if (!inplace && (a->grad || b->grad || c->grad)) {
6084 is_node = true;
6085 }
6086
6087 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
6088
6089 ggml_set_op_params(result, (const void *) &fun, sizeof(fun));
6090
6091 result->op = GGML_OP_MAP_CUSTOM3_F32;
6092 result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
6093 result->src[0] = a;
6094 result->src[1] = b;
6095 result->src[2] = c;
6096
6097 return result;
6098}
6099
6100struct ggml_tensor * ggml_map_custom3_f32(
6101 struct ggml_context * ctx,

Callers 2

ggml_map_custom3_f32Function · 0.85

Calls 3

ggml_view_tensorFunction · 0.70
ggml_dup_tensorFunction · 0.70
ggml_set_op_paramsFunction · 0.70

Tested by

no test coverage detected