File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -1410,16 +1410,14 @@ static bool ggml_is_contiguous_n(const struct ggml_tensor * tensor, int n) {
14101410 }
14111411 next_nb *= tensor -> ne [0 ]/ggml_blck_size (tensor -> type );
14121412 for (int i = 1 ; i < GGML_MAX_DIMS ; i ++ ) {
1413- if (tensor -> ne [i ] != 1 ) {
1414- if (i > n ) {
1415- if (tensor -> nb [i ] != next_nb ) {
1416- return false;
1417- }
1418- next_nb *= tensor -> ne [i ];
1419- } else {
1420- // this dimension does not need to be contiguous
1421- next_nb = tensor -> ne [i ]* tensor -> nb [i ];
1413+ if (i > n ) {
1414+ if (tensor -> ne [i ] != 1 && tensor -> nb [i ] != next_nb ) {
1415+ return false;
14221416 }
1417+ next_nb *= tensor -> ne [i ];
1418+ } else {
1419+ // this dimension does not need to be contiguous
1420+ next_nb = tensor -> ne [i ]* tensor -> nb [i ];
14231421 }
14241422 }
14251423 return true;
You can’t perform that action at this time.
0 commit comments