| 4990 | // ggml_soft_max_back |
| 4991 | |
| 4992 | static 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 | |
| 5013 | struct ggml_tensor * ggml_soft_max_back( |
| 5014 | struct ggml_context * ctx, |
no test coverage detected