Skip to content

Update BERT.py #61

New issue

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

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

Already on GitHub? # to your account

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

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

Successfully merging this pull request may close these issues.

2 participants