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

Function ggml_soft_max_back_impl

ggml.c:4992–5011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4990// ggml_soft_max_back
4991
4992static struct ggml_tensor * ggml_soft_max_back_impl(
4993 struct ggml_context * ctx,
4994 struct ggml_tensor * a,
4995 struct ggml_tensor * b,
4996 bool inplace) {
4997 bool is_node = false;
4998
4999 if (a->grad || b->grad) {
5000 is_node = true; // TODO : implement backward pass
5001 }
5002
5003 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
5004
5005 result->op = GGML_OP_SOFT_MAX_BACK;
5006 result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
5007 result->src[0] = a;
5008 result->src[1] = b;
5009
5010 return result;
5011}
5012
5013struct ggml_tensor * ggml_soft_max_back(
5014 struct ggml_context * ctx,

Callers 2

ggml_soft_max_backFunction · 0.85

Calls 2

ggml_view_tensorFunction · 0.70
ggml_dup_tensorFunction · 0.70

Tested by

no test coverage detected