Tech Challenge
2026-10-21
🤖
Daily Tech Challenge
AI & ML
medium
Question 1 of 5
A training script counts optimizer steps with the loop below. The dataset has 10,000 samples, batch_size is 64 and drop_last is left at its default. What does it print?
Example
import torch
from torch.utils.data import DataLoader, TensorDataset
ds = TensorDataset(torch.randn(10_000, 20), torch.randint(0, 2, (10_000,)))
loader = DataLoader(ds, batch_size=64, shuffle=True) # drop_last defaults to False
steps = 0
for epoch in range(3):
for xb, yb in loader:
# forward / backward / optimizer.step()
steps += 1
print(steps)Wednesday, October 21, 2026 · A new challenge drops every day