MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / ggml_cross_entropy_loss

Function ggml_cross_entropy_loss

subprojects/llama.cpp/ggml/src/ggml.c:5984–5997  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5982// ggml_cross_entropy_loss
5983
5984struct ggml_tensor * ggml_cross_entropy_loss(
5985 struct ggml_context * ctx,
5986 struct ggml_tensor * a,
5987 struct ggml_tensor * b) {
5988 GGML_ASSERT(ggml_are_same_shape(a, b));
5989
5990 struct ggml_tensor * result = ggml_new_tensor_1d(ctx, a->type, 1);
5991
5992 result->op = GGML_OP_CROSS_ENTROPY_LOSS;
5993 result->src[0] = a;
5994 result->src[1] = b;
5995
5996 return result;
5997}
5998
5999// ggml_cross_entropy_loss_back
6000

Callers 2

build_graphMethod · 0.85
ggml_opt_buildFunction · 0.85

Calls 2

ggml_are_same_shapeFunction · 0.85
ggml_new_tensor_1dFunction · 0.85

Tested by 1

build_graphMethod · 0.68