Why don’t it happen to me?
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 18:21:58) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> lstm = torch.nn.LSTM(input_size=1024,hidden_size=300,num_layers=2,bidirectional=True,batch_first=True)
>>> ip = torch.zeros(16, 4, 1024)
>>> hidden, state = lstm(ip)
>>> hidden.shape
torch.Size([16, 4, 600])
>>> state[0].shape
torch.Size([4, 16, 300])
>>> 

>>> torch.__version__
'0.4.0'
>>> torch.cuda.is_available()
True