check if t1 can be represented as a repetition of t0
| 1498 | |
| 1499 | // check if t1 can be represented as a repetition of t0 |
| 1500 | bool ggml_can_repeat(const struct ggml_tensor * t0, const struct ggml_tensor * t1) { |
| 1501 | static_assert(GGML_MAX_DIMS == 4, "GGML_MAX_DIMS is not 4 - update this function"); |
| 1502 | |
| 1503 | return ggml_is_empty(t0) ? ggml_is_empty(t1) : |
| 1504 | (t1->ne[0]%t0->ne[0] == 0) && |
| 1505 | (t1->ne[1]%t0->ne[1] == 0) && |
| 1506 | (t1->ne[2]%t0->ne[2] == 0) && |
| 1507 | (t1->ne[3]%t0->ne[3] == 0); |
| 1508 | } |
| 1509 | |
| 1510 | static inline bool ggml_can_repeat_rows(const struct ggml_tensor * t0, const struct ggml_tensor * t1) { |
| 1511 | static_assert(GGML_MAX_DIMS == 4, "GGML_MAX_DIMS is not 4 - update this function"); |
no test coverage detected