Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: fix runtime error when ContextFullDataLoader is empty #723

Merged
merged 3 commits into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions recbole/config/eval_setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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'}
Expand Down
2 changes: 1 addition & 1 deletion recbole/data/dataloader/general_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__(
Expand Down