| 5982 | // ggml_cross_entropy_loss |
| 5983 | |
| 5984 | struct 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 |