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

Update BERT.py #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update BERT.py #61

wants to merge 1 commit into from

Conversation

colinpeth
Copy link

Added torch.cuda to utilize cuda if available.

Added torch.cuda to utilize cuda if available.
Comment on lines +230 to +233
if torch.cuda.is_available():
input_ids, segment_ids, masked_tokens, masked_pos, isNext = map(torch.cuda.LongTensor, zip(batch[0]))
else:
input_ids, segment_ids, masked_tokens, masked_pos, isNext = map(torch.LongTensor, zip(batch[0]))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code you modified is incorrect

Comment on lines +212 to +215
if torch.cuda.is_available():
input_ids, segment_ids, masked_tokens, masked_pos, isNext = map(torch.cuda.LongTensor, zip(*batch))
else:
input_ids, segment_ids, masked_tokens, masked_pos, isNext = map(torch.LongTensor, zip(*batch))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code you modified is incorrect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants