| 2801 | // ggml_glu |
| 2802 | |
| 2803 | static struct ggml_tensor * ggml_glu_impl( |
| 2804 | struct ggml_context * ctx, |
| 2805 | struct ggml_tensor * a, |
| 2806 | struct ggml_tensor * b, |
| 2807 | enum ggml_glu_op op, |
| 2808 | bool swapped) { |
| 2809 | GGML_ASSERT(ggml_is_contiguous_1(a)); |
| 2810 | |
| 2811 | if (b) { |
| 2812 | GGML_ASSERT(ggml_is_contiguous_1(b)); |
| 2813 | GGML_ASSERT(ggml_are_same_shape(a, b)); |
| 2814 | GGML_ASSERT(a->type == b->type); |
| 2815 | } |
| 2816 | |
| 2817 | int64_t ne[GGML_MAX_DIMS] = { a->ne[0] / 2 }; for (int i = 1; i < GGML_MAX_DIMS; i++) ne[i] = a->ne[i]; |
| 2818 | struct ggml_tensor * result = ggml_new_tensor_impl(ctx, a->type, GGML_MAX_DIMS, b ? a->ne : ne, NULL, 0); |
| 2819 | |
| 2820 | ggml_set_op_params_i32(result, 0, (int32_t) op); |
| 2821 | ggml_set_op_params_i32(result, 1, (int32_t) swapped); |
| 2822 | |
| 2823 | result->op = GGML_OP_GLU; |
| 2824 | result->src[0] = a; |
| 2825 | result->src[1] = b; |
| 2826 | |
| 2827 | return result; |
| 2828 | } |
| 2829 | |
| 2830 | // ggml_floor |
| 2831 |
no test coverage detected