We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
return {'input_ids': torch.tensor(input_ids).long(), 'attention_mask': attention_mask, 'labels': torch.stack(labels), 'position_ids':torch.stack(position_ids)} 这里为什么有torch.tensor()和torch.stack()呢? 不写成torch.stack()有时会报ValueError: expected sequence of length 50 at dim 1 (got 49)这个错,可以解答一下吗?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
return {'input_ids': torch.tensor(input_ids).long(),
'attention_mask': attention_mask,
'labels': torch.stack(labels),
'position_ids':torch.stack(position_ids)}
这里为什么有torch.tensor()和torch.stack()呢?
不写成torch.stack()有时会报ValueError: expected sequence of length 50 at dim 1 (got 49)这个错,可以解答一下吗?
The text was updated successfully, but these errors were encountered: