check tc false positive
The following program gives Type pattern error in application of averageOuter: feature
d:shp' in return value does not match feature shp' in arrayCompilation failed while Running SAC optimizations
. I think the program is correct however. It should average batchsize
many copies of k1
.
use Array: all;
inline
float[d:shp] averageOuter(float[n,d:shp] array)
{
return {iv -> sum({[i] -> array[[i]++iv] | [i] < [n]}) | iv < shp};
}
int main()
{
batchsize = 100;
k1 = with {}: genarray([6, 5, 5], 1f / 25f);
/* [batchsize, 6, 5, 5] */
bd_k1 = {iv -> k1 | iv < [batchsize]};
k1 = averageOuter(bd_k1);
return _toi_S_(_sel_VxA_([0, 0, 0], k1));
}
Compiled with arguments -check tc
sac2c 1.3.3-MijasCosta-1153-g14eb
build-type: DEBUG
built-by: "thomas" at 2024-02-12T12:49:22