remove barely-useful elType==el_i32 path of reshape
perhaps could be replaced with an <=el_i32 path that still uses GetU but just skips numberness/integerness checks and ∘/⌊/⌽/↑ logic
This commit is contained in:
parent
26a4bc9ac3
commit
5abb09ca74
@ -160,22 +160,11 @@ B shape_c2(B t, B w, B x) {
|
|||||||
nr = 1;
|
nr = 1;
|
||||||
sh = NULL;
|
sh = NULL;
|
||||||
} else {
|
} else {
|
||||||
if (isAtm(w)) w = m_unit(w);
|
if (RARE(isAtm(w))) w = m_unit(w);
|
||||||
if (RNK(w)>1) thrM("⥊: 𝕨 must have rank at most 1");
|
if (RNK(w)>1) thrM("⥊: 𝕨 must have rank at most 1");
|
||||||
if (IA(w)>UR_MAX) thrM("⥊: Result rank too large");
|
if (IA(w)>UR_MAX) thrM("⥊: Result rank too large");
|
||||||
nr = IA(w);
|
nr = IA(w);
|
||||||
sh = nr<=1? NULL : m_shArr(nr);
|
sh = nr<=1? NULL : m_shArr(nr);
|
||||||
if (TI(w,elType)==el_i32) {
|
|
||||||
i32* wi = i32any_ptr(w);
|
|
||||||
if (nr>1) for (i32 i = 0; i < nr; i++) sh->a[i] = wi[i];
|
|
||||||
bool bad=false, good=false;
|
|
||||||
for (i32 i = 0; i < nr; i++) {
|
|
||||||
if (wi[i]<0) thrF("⥊: 𝕨 contained %i", wi[i]);
|
|
||||||
bad|= mulOn(nia, wi[i]);
|
|
||||||
good|= wi[i]==0;
|
|
||||||
}
|
|
||||||
if (bad && !good) thrM("⥊: 𝕨 too large");
|
|
||||||
} else {
|
|
||||||
SGetU(w)
|
SGetU(w)
|
||||||
i32 unkPos = -1;
|
i32 unkPos = -1;
|
||||||
i32 unkInd ONLY_GCC(=0);
|
i32 unkInd ONLY_GCC(=0);
|
||||||
@ -223,7 +212,6 @@ B shape_c2(B t, B w, B x) {
|
|||||||
xia = nia;
|
xia = nia;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
decG(w);
|
decG(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user