lib/torch/utils/data/data_loader.rb in torch-rb-0.8.1 vs lib/torch/utils/data/data_loader.rb in torch-rb-0.8.2
- old
+ new
@@ -23,9 +23,11 @@
@collate_fn = collate_fn
end
def each
+ return to_enum(:each) unless block_given?
+
# try to keep the random number generator in sync with Python
# this makes it easy to compare results
base_seed = Torch.empty([], dtype: :int64).random!.item
indexes =