(data, starts, ends, axes, steps)
| 1139 | * @returns {Promise<Tensor>} Sliced data tensor. |
| 1140 | */ |
| 1141 | export async function slice(data, starts, ends, axes, steps) { |
| 1142 | const op = await TensorOpRegistry.slice; |
| 1143 | return await op({ |
| 1144 | x: data, |
| 1145 | s: arrayToIndexTensor(starts), |
| 1146 | e: arrayToIndexTensor(ends), |
| 1147 | a: arrayToIndexTensor(axes), |
| 1148 | t: arrayToIndexTensor(steps ?? new Array(axes.length).fill(1)), |
| 1149 | }); |
| 1150 | } |
| 1151 | |
| 1152 | /** |
| 1153 | * Perform mean pooling of the last hidden state followed by a normalization step. |
no test coverage detected