* Groups elements into batches, represented in column-major form. * * We can think of the elements of this iterator as 'rows' (even if they are * nested structures). By the same token, consecutive values for a given * key within the elements form a 'column'. This matches the usual sens
(
batchSize: number, smallLastBatch = true,
// tslint:disable-next-line:no-any
zipFn: (xs: any[]) => DeepMapResult = zipToList)
| 385 | * with collections at the leaves. |
| 386 | */ |
| 387 | columnMajorBatch( |
| 388 | batchSize: number, smallLastBatch = true, |
| 389 | // tslint:disable-next-line:no-any |
| 390 | zipFn: (xs: any[]) => DeepMapResult = zipToList): |
| 391 | LazyIterator<tf.TensorContainer> { |
| 392 | // First collect the desired number of input elements as a row-major batch. |
| 393 | const rowBatches = this.rowMajorBatch(batchSize, smallLastBatch); |
| 394 | // Now 'rotate' or 'pivot' the data, collecting all values from each column |
| 395 | // in the batch (i.e., for each key within the elements) into an array. |
| 396 | return rowBatches.map(x => deepZip(x, zipFn)); |
| 397 | } |
| 398 | |
| 399 | /** |
| 400 | * Concatenate this `LazyIterator` with another. |
nothing calls this directly
no test coverage detected
searching dependent graphs…