Unbabel / OpenKiwi

Open-Source Machine Translation Quality Estimation in PyTorch
https://unbabel.github.io/OpenKiwi/
GNU Affero General Public License v3.0
229 stars 48 forks source link

Fix device assignment for pytorch compatibility solving #43 #44

Closed captainvera closed 4 years ago

captainvera commented 4 years ago

The changes are very minor, they just make sure that all tensors share the same device. This avoids pytorch crashing from making the mask &= (..) operation with a (just created) cpu tensor.