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

Function ggml_map_custom1_impl_f32

ggml.c:5994–6014  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5992// ggml_map_custom1_f32
5993
5994static struct ggml_tensor * ggml_map_custom1_impl_f32(
5995 struct ggml_context * ctx,
5996 struct ggml_tensor * a,
5997 const ggml_custom1_op_f32_t fun,
5998 bool inplace) {
5999 bool is_node = false;
6000
6001 if (!inplace && a->grad) {
6002 is_node = true;
6003 }
6004
6005 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
6006
6007 ggml_set_op_params(result, (const void *) &fun, sizeof(fun));
6008
6009 result->op = GGML_OP_MAP_CUSTOM1_F32;
6010 result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
6011 result->src[0] = a;
6012
6013 return result;
6014}
6015
6016struct ggml_tensor * ggml_map_custom1_f32(
6017 struct ggml_context * ctx,

Callers 2

ggml_map_custom1_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