diff --git a/recbole/config/eval_setting.py b/recbole/config/eval_setting.py index c377eb51a..30ed04f8e 100644 --- a/recbole/config/eval_setting.py +++ b/recbole/config/eval_setting.py @@ -203,7 +203,7 @@ def set_splitting(self, strategy='none', **kwargs): legal_strategy = {'none', 'by_ratio', 'by_value', 'loo'} if strategy not in legal_strategy: raise ValueError('Split Strategy [{}] should in {}'.format(strategy, list(legal_strategy))) - if strategy == 'loo' and self.group_by is None: + if strategy == 'loo' and self.group_field is None: raise ValueError('Leave-One-Out request group firstly') self.split_args = {'strategy': strategy} self.split_args.update(kwargs) @@ -251,7 +251,7 @@ def set_neg_sampling(self, strategy='none', distribution='uniform', **kwargs): distribution (str): distribution of sampler, either 'uniform' or 'popularity'. Example: - >>> es.neg_sample_to(100) + >>> es.full() >>> es.neg_sample_by(1) """ legal_strategy = {'none', 'full', 'by'} diff --git a/recbole/data/dataloader/general_dataloader.py b/recbole/data/dataloader/general_dataloader.py index 4e91dd945..818571586 100644 --- a/recbole/data/dataloader/general_dataloader.py +++ b/recbole/data/dataloader/general_dataloader.py @@ -230,7 +230,7 @@ def __init__( positive_item = set() positive_item.add(iid) self._set_user_property(last_uid, uid2used_item[last_uid], positive_item) - self.uid_list = torch.tensor(self.uid_list) + self.uid_list = torch.tensor(self.uid_list, dtype=torch.int64) self.user_df = dataset.join(Interaction({uid_field: self.uid_list})) super().__init__(