(batch, num_expand)
| 197 | |
| 198 | |
| 199 | def unfold_batch(batch, num_expand): |
| 200 | assert num_expand >= 0 |
| 201 | if num_expand == 0: |
| 202 | return batch |
| 203 | if num_expand > 1: |
| 204 | batch = [sample.reshape((-1,) + sample.shape[num_expand:]) for sample in batch] |
| 205 | return [frame for sample in batch for frame in sample] |
| 206 | |
| 207 | |
| 208 | def unfold_batches(batches, num_expand): |
no test coverage detected