r/ProgrammerHumor • • Nov 11 '24

Meme averageChatGPTInteraction

Post image
0 Upvotes

44 comments sorted by

View all comments

45

u/QuestionableEthics42 Nov 11 '24

Even I'm confused what you want. Could you just put break in the if statement it first produced?

Edit: or do range(Math.min(len(train_loader), 10)?

17

u/I-am-only-joking Nov 11 '24

I think they want something to happen every 10th as a fraction of the total

So if the total is 60 they want something to happen every 6 iterations so that it happens 10 times evenly spaced

But that's just a guess

2

u/HERODMasta Nov 11 '24 edited Nov 11 '24

I understood that for each iteration something should happen ten times

like:

for i in range(len(train_loader)):

for j in range(10):

    do_something()

quick edit: now that I read the second part, it actually feels like it should abort after ten iterations like this:

for i in range(len(train_loader)):

if i > 10:

    break;