MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_is_contiguous

Function ggml_is_contiguous

ggml.c:2084–2092  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2082}
2083
2084bool 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
2094static 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");

Callers 15

ggml_get_i32_1dFunction · 0.70
ggml_set_i32_1dFunction · 0.70
ggml_get_f32_1dFunction · 0.70
ggml_set_f32_1dFunction · 0.70
ggml_acc_implFunction · 0.70
ggml_reshapeFunction · 0.70
ggml_reshape_1dFunction · 0.70
ggml_reshape_2dFunction · 0.70
ggml_reshape_3dFunction · 0.70
ggml_reshape_4dFunction · 0.70
ggml_add_rel_pos_implFunction · 0.70

Calls 2

ggml_type_sizeFunction · 0.70
ggml_blck_sizeFunction · 0.70

Tested by

no test coverage detected