Loading vectors into a GPU
saeeddhqan opened this issue Β· comments
Saeed Dehqan commented
π Feature
Is there any way for loading vectors based on device with torchtext.vocab.Vectors class?
Joe Cummings commented
This can be accomplished with our prototype Vectors class, which will eventually replace the current implementation.
See here:
text/torchtext/prototype/vectors.py
Line 202 in 79100a6
Saeed Dehqan commented
So, we don't need to change the current implementation to do so, right?
Joe Cummings commented
Nope! You can just do:
vectors = Vectors()
vectors.to(device="cuda")
Saeed Dehqan commented
thanks!