| 3735 | // ggml_concat |
| 3736 | |
| 3737 | struct ggml_tensor * ggml_concat( |
| 3738 | struct ggml_context* ctx, |
| 3739 | struct ggml_tensor* a, |
| 3740 | struct ggml_tensor* b) { |
| 3741 | GGML_ASSERT(a->ne[0] == b->ne[0] && a->ne[1] == b->ne[1] && a->ne[3] == b->ne[3]); |
| 3742 | |
| 3743 | bool is_node = false; |
| 3744 | |
| 3745 | if (a->grad || b->grad) { |
| 3746 | is_node = true; |
| 3747 | } |
| 3748 | |
| 3749 | struct ggml_tensor * result = ggml_new_tensor_4d(ctx, a->type, a->ne[0], a->ne[1], a->ne[2] + b->ne[2], a->ne[3]); |
| 3750 | |
| 3751 | result->op = GGML_OP_CONCAT; |
| 3752 | result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL; |
| 3753 | result->src[0] = a; |
| 3754 | result->src[1] = b; |
| 3755 | |
| 3756 | return result; |
| 3757 | } |
| 3758 | |
| 3759 | // ggml_abs |
| 3760 |
no test coverage detected