add assertion for arr_shReplace rank expectation

This commit is contained in:
dzaima 2023-04-21 15:50:42 +03:00
parent 01b17ea0d9
commit 9bb7fa406b

View File

@ -102,7 +102,8 @@ static Arr* arr_shCopyUnchecked(Arr* n, B o) {
} }
return n; return n;
} }
static Arr* arr_shReplace(Arr* x, ur r, ShArr* sh) { // replace x's shape with a new one static Arr* arr_shReplace(Arr* x, ur r, ShArr* sh) { // replace x's shape with a new one; assumes r>1, but PRNK(x) can be anything
assert(r>1);
usz* prevsh = x->sh; usz* prevsh = x->sh;
u8 xr = PRNK(x); u8 xr = PRNK(x);
SPRNK(x, r); SPRNK(x, r);