(model, total_samples, hidden_dim, device, dtype=preferred_dtype())
| 250 | |
| 251 | |
| 252 | def random_dataloader(model, total_samples, hidden_dim, device, dtype=preferred_dtype()): |
| 253 | batch_size = model.train_micro_batch_size_per_gpu() |
| 254 | train_dataset = random_dataset(total_samples, hidden_dim, device, dtype=dtype) |
| 255 | train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=batch_size) |
| 256 | return train_loader |
| 257 | |
| 258 | |
| 259 | def sequence_dataloader(model, total_samples, hidden_dim, device, seq_len: int = 32, dtype=preferred_dtype()): |