Some libraries may break if you change the default tensor type.
I ran into a problem with allennlp's ElmoEncoder when I had set the default tensor to cuda.FloatTensor.
In case anyone else runs into that error, the first error you get is:
RuntimeError: 'lengths' argument should be a 1D CPU int64 tensor
which then leads to a second error:
RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same