PetrochukM / PyTorch-NLP

Basic Utilities for PyTorch Natural Language Processing (NLP)
https://pytorchnlp.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2.21k stars 258 forks source link

Could this be improved? #107

Closed PetrochukM closed 4 years ago

PetrochukM commented 4 years ago

Look into how pickle works to implement a method for getting every tensor: https://github.com/PetrochukM/PyTorch-NLP/blob/be1a08edbd898d30273b7062c9c16fcf7f788787/torchnlp/utils.py#L35

Could we replicate torch.loads ability to move all tensors in an object between devices? torch.load uses pickle to do that.