* @param {number} index * @param {number} iterSize * @param {any} iterDims * @returns {Tensor}
(index, iterSize, iterDims)
| 172 | * @returns {Tensor} |
| 173 | */ |
| 174 | _subarray(index, iterSize, iterDims) { |
| 175 | const o1 = index * iterSize; |
| 176 | const o2 = (index + 1) * iterSize; |
| 177 | |
| 178 | // We use subarray if available (typed array), otherwise we use slice (normal array) |
| 179 | const data = 'subarray' in this.data ? this.data.subarray(o1, o2) : this.data.slice(o1, o2); |
| 180 | return new Tensor(this.type, data, iterDims); |
| 181 | } |
| 182 | |
| 183 | /** |
| 184 | * Returns the value of this tensor as a standard JavaScript Number. This only works |
no test coverage detected