| 2082 | } |
| 2083 | |
| 2084 | bool ggml_is_contiguous(const struct ggml_tensor * tensor) { |
| 2085 | static_assert(GGML_MAX_DIMS == 4, "GGML_MAX_DIMS is not 4 - update this function"); |
| 2086 | |
| 2087 | return |
| 2088 | tensor->nb[0] == ggml_type_size(tensor->type) && |
| 2089 | tensor->nb[1] == (tensor->nb[0]*tensor->ne[0])/ggml_blck_size(tensor->type) && |
| 2090 | tensor->nb[2] == tensor->nb[1]*tensor->ne[1] && |
| 2091 | tensor->nb[3] == tensor->nb[2]*tensor->ne[2]; |
| 2092 | } |
| 2093 | |
| 2094 | static inline bool ggml_is_contiguous_except_dim_1(const struct ggml_tensor * tensor) { |
| 2095 | static_assert(GGML_MAX_DIMS == 4, "GGML_MAX_DIMS is not 4 - update this function"); |
no test coverage detected