galsang / BiDAF-pytorch

Re-implementation of BiDAF(Bidirectional Attention Flow for Machine Comprehension, Minjoon Seo et al., ICLR 2017) on PyTorch.
244 stars 85 forks source link

Setting device through GPU ID deprecated for Iterator class #15

Closed ghost closed 5 years ago

ghost commented 5 years ago

While training on the GPU, setting the iterator through the GPU ID has been deprecated. Doing it this way causes all tensors to fall back to being placed on the CPU which causes undefined behavior. The device needs to be set through torch.device.