| 3584 | } |
| 3585 | |
| 3586 | struct ggml_tensor * ggml_reshape_4d( |
| 3587 | struct ggml_context * ctx, |
| 3588 | struct ggml_tensor * a, |
| 3589 | int64_t ne0, |
| 3590 | int64_t ne1, |
| 3591 | int64_t ne2, |
| 3592 | int64_t ne3) { |
| 3593 | GGML_ASSERT(ggml_is_contiguous(a)); |
| 3594 | GGML_ASSERT(ggml_nelements(a) == ne0*ne1*ne2*ne3); |
| 3595 | |
| 3596 | const int64_t ne[4] = { ne0, ne1, ne2, ne3 }; |
| 3597 | struct ggml_tensor * result = ggml_new_tensor_impl(ctx, a->type, 4, ne, a, 0); |
| 3598 | ggml_format_name(result, "%s (reshaped)", a->name); |
| 3599 | |
| 3600 | result->op = GGML_OP_RESHAPE; |
| 3601 | result->src[0] = a; |
| 3602 | |
| 3603 | return result; |
| 3604 | } |
| 3605 | |
| 3606 | static struct ggml_tensor * ggml_view_impl( |
| 3607 | struct ggml_context * ctx, |
no test coverage detected