kmkurn / pytorch-crf

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

Add shape comments on every line that produces tensor #9

Closed kmkurn closed 5 years ago

kmkurn commented 6 years ago

Something like:

# shape: (batch_size, seq_length)
words = words.transpose(0, 1).contiguous()

so it's easy to keep track of the shapes.