(tensors, dim = 0)
| 1369 | * @returns {Tensor} The stacked tensor. |
| 1370 | */ |
| 1371 | export function stack(tensors, dim = 0) { |
| 1372 | // TODO do validation of shapes |
| 1373 | // NOTE: stack expects each tensor to be equal size |
| 1374 | return cat( |
| 1375 | tensors.map((t) => t.unsqueeze(dim)), |
| 1376 | dim, |
| 1377 | ); |
| 1378 | } |
| 1379 | |
| 1380 | /** |
| 1381 | * @param {(previousValue: any, currentValue: any, currentIndex?: number, resultIndex?: number) => any} callbackfn |
no test coverage detected