kmkurn / pytorch-crf

(Linear-chain) Conditional random field in PyTorch.
https://pytorch-crf.readthedocs.io
MIT License
935 stars 151 forks source link

BUG fixed: mask tensor should be on cuda also by condition. #101

Closed zhuobinggang closed 1 year ago

zhuobinggang commented 2 years ago

BUG fixed: mask tensor should be on cuda also by condition.

I was using this repository, and there was a ERROR when using the GPU, and I changed the source code of the local repository myself and it worked.

kmkurn commented 2 years ago

Hi, thanks for the PR. About your issue, have you checked that tags has been moved to GPU? Tensor mask is created in the same device as tags because torch.ones_like is used.

zhuobinggang commented 1 year ago

Thank you, that is my problem.