-
Notifications
You must be signed in to change notification settings - Fork 68
A code issue #16
Comments
Hi @Wastedzz @maoxiaowei97, thank you for your interest. I believe you may be using an incorrect version of PyTorch -- the code was tested with a now ancient version 0.4, but PyTorch has undergone several changes since then. For reproducing exactly, you may have to downgrade your PyTorch version. |
Here are some related issues and discussions for reference: Maybe one simple thing to try first to get the code to run would be to update backpointers via integer division:
|
you are right, thanks for your reply! |
You are right. I've figured it out, and it worked. Thank you so much! |
Great, happy to help, no worries. |
perm_mask = perm_mask.type(torch.int64) just add in this before gather() line to change the datatype to int64 |
hi, thanks for your open-source code. I met a bug when I run the beam search code in utilis/beamsearch.py line96:
self.mask = self.mask.gather(1, perm_mask)
where 'perm_mask' should be a LongTensor type, but here its type is FloatTensor. It makes severl beam search-based functions fail to use.
The text was updated successfully, but these errors were encountered: