Closed light8lee closed 5 years ago
Hi,
The mask is expected to be a ByteTensor
. Try changing your code to scores = self.crf(emissions, target_tags, input_masks.byte())
.
Thank you. I found the description in pytorch docs: all() methods are unique to torch.ByteTensor.
I'm using this model on Python 3.6.5, Pytorch 1.0.1 on docker, here is the traceback:
It seems that mask[:, 0].all() dont work on
cuda.LongTensor