From: Francois Fleuret Date: Mon, 19 Jun 2017 16:26:17 +0000 (+0200) Subject: Bug fix. Ouch, that was bad. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=faac6461d3482204898ad97f811f58889cc37e1d;p=pysvrt.git Bug fix. Ouch, that was bad. --- diff --git a/svrtset.py b/svrtset.py index 49f3279..8bfdde1 100755 --- a/svrtset.py +++ b/svrtset.py @@ -48,10 +48,11 @@ class VignetteSet: raise self.cuda = cuda - self.batch_size = batch_size self.problem_number = problem_number - self.nb_batches = nb_samples // batch_size - self.nb_samples = self.nb_batches * self.batch_size + + self.batch_size = batch_size + self.nb_samples = nb_samples + self.nb_batches = self.nb_samples // self.batch_size seeds = torch.LongTensor(self.nb_batches).random_() mp_args = [] @@ -96,10 +97,12 @@ class CompressedVignetteSet: raise self.cuda = cuda - self.batch_size = batch_size self.problem_number = problem_number - self.nb_batches = nb_samples // batch_size - self.nb_samples = self.nb_batches * self.batch_size + + self.batch_size = batch_size + self.nb_samples = nb_samples + self.nb_batches = self.nb_samples // self.batch_size + self.targets = [] self.input_storages = []