Convert multi-dimensional index to the position in the flat list.
(ndim, ind, strides)
| 327 | return product(*iterables) |
| 328 | |
| 329 | def getindex(ndim, ind, strides): |
| 330 | """Convert multi-dimensional index to the position in the flat list.""" |
| 331 | ret = 0 |
| 332 | for i in range(ndim): |
| 333 | ret += strides[i] * ind[i] |
| 334 | return ret |
| 335 | |
| 336 | def transpose(src, shape): |
| 337 | """Transpose flat item list that is regarded as a multi-dimensional |