Skip to content

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.

2 participants