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

Function ggml_map_custom2_impl_f32

ggml.c:6032–6054  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6030// ggml_map_custom2_f32
6031
6032static struct ggml_tensor * ggml_map_custom2_impl_f32(
6033 struct ggml_context * ctx,
6034 struct ggml_tensor * a,
6035 struct ggml_tensor * b,
6036 const ggml_custom2_op_f32_t fun,
6037 bool inplace) {
6038 bool is_node = false;
6039
6040 if (!inplace && (a->grad || b->grad)) {
6041 is_node = true;
6042 }
6043
6044 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
6045
6046 ggml_set_op_params(result, (const void *) &fun, sizeof(fun));
6047
6048 result->op = GGML_OP_MAP_CUSTOM2_F32;
6049 result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
6050 result->src[0] = a;
6051 result->src[1] = b;
6052
6053 return result;
6054}
6055
6056struct ggml_tensor * ggml_map_custom2_f32(
6057 struct ggml_context * ctx,

Callers 2

ggml_map_custom2_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