diff --git a/recbole/data/dataloader/abstract_dataloader.py b/recbole/data/dataloader/abstract_dataloader.py index afa39a213..59f6398fd 100644 --- a/recbole/data/dataloader/abstract_dataloader.py +++ b/recbole/data/dataloader/abstract_dataloader.py @@ -136,8 +136,8 @@ def _set_neg_sample_args(self, config, dataset, dl_format, neg_sample_args): self.neg_sample_args = neg_sample_args self.times = 1 if ( - self.neg_sample_args["distribution"] == "uniform" - or self.neg_sample_args["distribution"] == "popularity" + (self.neg_sample_args["distribution"] == "uniform" + or self.neg_sample_args["distribution"] == "popularity") and self.neg_sample_args["sample_num"] != "none" ): self.neg_sample_num = self.neg_sample_args["sample_num"]