| 400 | } |
| 401 | |
| 402 | static bool ggml_are_same_layout(const struct ggml_tensor * a, const struct ggml_tensor * b) { |
| 403 | if (a->type != b->type) { |
| 404 | return false; |
| 405 | } |
| 406 | for (int i = 0; i < GGML_MAX_DIMS; i++) { |
| 407 | if (a->ne[i] != b->ne[i]) { |
| 408 | return false; |
| 409 | } |
| 410 | if (a->nb[i] != b->nb[i]) { |
| 411 | return false; |
| 412 | } |
| 413 | } |
| 414 | return true; |
| 415 | } |
| 416 | |
| 417 | static bool ggml_op_can_inplace(enum ggml_op op) { |
| 418 | switch (op) { |