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

Function ggml_soft_max_impl

ggml.c:4959–4976  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4957// ggml_soft_max
4958
4959static struct ggml_tensor * ggml_soft_max_impl(
4960 struct ggml_context * ctx,
4961 struct ggml_tensor * a,
4962 bool inplace) {
4963 bool is_node = false;
4964
4965 if (a->grad) {
4966 is_node = true;
4967 }
4968
4969 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
4970
4971 result->op = GGML_OP_SOFT_MAX;
4972 result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
4973 result->src[0] = a;
4974
4975 return result;
4976}
4977
4978struct ggml_tensor * ggml_soft_max(
4979 struct ggml_context * ctx,

Callers 2

ggml_soft_maxFunction · 0.70
ggml_soft_max_inplaceFunction · 0.70

Calls 2

ggml_view_tensorFunction · 0.70
ggml_dup_tensorFunction · 0.70

Tested by

no test coverage detected