The writing method will result in iterating the first element every time, and it costs time heavily
for i in range(args.n_updates): (x, _) = next(iter(training_loader))
why not just do it as bellow,
training_loader = iter(training_loader) for i in range(args.n_updates): (x, _) = next(training_loader)
The writing method will result in iterating the first element every time, and it costs time heavily
for i in range(args.n_updates): (x, _) = next(iter(training_loader))
why not just do it as bellow,
training_loader = iter(training_loader) for i in range(args.n_updates): (x, _) = next(training_loader)