kmkurn / pytorch-crf

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

Move dims and sizes checking to another method #8

Closed kmkurn closed 5 years ago

kmkurn commented 6 years ago

Right now checking dimensions and sizes of tensors are duplicated inside forward and decode. It'd be nice if they can be factored out into a single method.