Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def __init__(self, data_source, num_epochs, start_itr=0, batch_size=128):
self.data_source = data_source
self.num_samples = len(self.data_source)
self.num_epochs = num_epochs
self.start_itr = start_itr
self.start_itr = start_itr%int((self.num_samples*self.num_epochs)/batch_size)
self.batch_size = batch_size

if not isinstance(self.num_samples, int) or self.num_samples <= 0:
Expand All @@ -514,6 +514,7 @@ def __iter__(self):
# return iter(.tolist())
output = torch.cat(out).tolist()
print('Length dataset output is %d' % len(output))
self.start_itr = 0
return iter(output)

def __len__(self):
Expand Down