sr
Size: a a a
В
sr
IS
j
j
IS
IS
function _reshape (array, sizes) {а вот из исходников код
// testing if there are enough elements for the requested shape
let tmpArray = array
let tmpArray2
// for each dimensions starting by the last one and ignoring the first one
for (let sizeIndex = sizes.length - 1; sizeIndex > 0; sizeIndex--) {
const size = sizes[sizeIndex]
tmpArray2 = []
// aggregate the elements of the current tmpArray in elements of the requested size
const length = tmpArray.length / size
for (let i = 0; i < length; i++) {
tmpArray2.push(tmpArray.slice(i * size, (i + 1) * size))
}
// set it as the new tmpArray for the next loop turn or for return
tmpArray = tmpArray2
}
return tmpArray
}
I
IS
IS
I
I
IS
IS
РБ
I
IS
I
IS