| 3565 | } |
| 3566 | |
| 3567 | struct ggml_tensor * ggml_reshape_3d( |
| 3568 | struct ggml_context * ctx, |
| 3569 | struct ggml_tensor * a, |
| 3570 | int64_t ne0, |
| 3571 | int64_t ne1, |
| 3572 | int64_t ne2) { |
| 3573 | GGML_ASSERT(ggml_is_contiguous(a)); |
| 3574 | GGML_ASSERT(ggml_nelements(a) == ne0*ne1*ne2); |
| 3575 | |
| 3576 | const int64_t ne[3] = { ne0, ne1, ne2 }; |
| 3577 | struct ggml_tensor * result = ggml_new_tensor_impl(ctx, a->type, 3, ne, a, 0); |
| 3578 | ggml_format_name(result, "%s (reshaped)", a->name); |
| 3579 | |
| 3580 | result->op = GGML_OP_RESHAPE; |
| 3581 | result->src[0] = a; |
| 3582 | |
| 3583 | return result; |
| 3584 | } |
| 3585 | |
| 3586 | struct ggml_tensor * ggml_reshape_4d( |
| 3587 | struct ggml_context * ctx, |