harvardnlp / pytorch-struct

Fast, general, and tested differentiable structured prediction in PyTorch
http://harvardnlp.github.io/pytorch-struct
MIT License
1.11k stars 93 forks source link

Remove imperative filling functions _ #105

Closed srush closed 3 years ago

srush commented 3 years ago

This PR moves from the modifying tensors inline to instead using torch.where to create new ones.

This has a couple of advantages namely :