| 3251 | } |
| 3252 | |
| 3253 | struct ggml_tensor * ggml_out_prod( |
| 3254 | struct ggml_context * ctx, |
| 3255 | struct ggml_tensor * a, |
| 3256 | struct ggml_tensor * b) { |
| 3257 | GGML_ASSERT(ggml_can_out_prod(a, b)); |
| 3258 | GGML_ASSERT(!ggml_is_transposed(a)); |
| 3259 | |
| 3260 | // a is broadcastable to b for ne[2] and ne[3] -> use b->ne[2] and b->ne[3] |
| 3261 | const int64_t ne[4] = { a->ne[0], b->ne[0], b->ne[2], b->ne[3] }; |
| 3262 | struct ggml_tensor * result = ggml_new_tensor(ctx, GGML_TYPE_F32, 4, ne); |
| 3263 | |
| 3264 | result->op = GGML_OP_OUT_PROD; |
| 3265 | result->src[0] = a; |
| 3266 | result->src[1] = b; |
| 3267 | |
| 3268 | return result; |
| 3269 | } |
| 3270 | |
| 3271 | // ggml_scale |
| 3272 | |