GitHub

Original file line numberDiff line numberDiff line change

@@ -517,16 +517,9 @@ af_err af_iota(af_array *result, const unsigned ndims, const dim_t * const dims,

517517
518518

DIM_ASSERT(1, ndims > 0 && ndims <= 4);

519519

DIM_ASSERT(3, t_ndims > 0 && t_ndims <= 4);

520-

dim4 d;

521-

dim4 t;

522-

for(unsigned i = 0; i < 4; i++) {

523-

d[i] = dims[i];

524-

DIM_ASSERT(2, d[i] >= 1);

525-

}

526-

for(unsigned i = 0; i < 4; i++) {

527-

t[i] = tdims[i];

528-

DIM_ASSERT(4, t[i] >= 1);

529-

}

520+
521+

dim4 d = verifyDims(ndims, dims);

522+

dim4 t = verifyDims(t_ndims, tdims);

530523
531524

switch(type) {

532525

case f32: out = iota_<float >(d, t); break;

Read the original on github.com ↗