()
| 248 | return fill([]); |
| 249 | } |
| 250 | |
| 251 | /** Indices are 1-based, return a 0-based index in the data */ |
| 252 | private _index(indices: number[]): number { |
| 253 | const strides = this._strides; |
| 254 | return indices.reduce((acc, val, dim) => acc + (val - 1) * strides[dim], 0); |
| 255 | // let index = 0; |
| 256 | // for (let i = 0; i < indices.length; i++) { |
| 257 | // index += indices[i] * this._strides[i]; |
| 258 | // } |
| 259 | // return index; |
| 260 | } |
| 261 |