title: problems on google colab pytorch learning-RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu
body: <p>I'm very newbie on pytorch and deep learning, and I got some error while running a sample code from deep learning class.</p>
  <p>When I run the code I attached below, There comes an errors like,</p>
  <pre><code>text = torch.from_numpy(data['text']).long().cuda(0)
  
  # feature extraction
  mel_gt = get_mel(audio)
  
  # shift mel spectrogram -&gt; the input of the network
  mel_shift = torch.cat((torch.zeros_like(mel_gt)[:,:,:1], mel_gt[:,:,:-1]) ,axis=-1)
  
  # inference
  mel_est, attention = model(mel_shift, text)
  </code></pre>
  <p><strong>RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!</strong></p>
  <p>I can hardly understand because I also check whether the tensors are on cuba with these code, they all return true..</p>
  <pre><code>print(mel_shift.is_cuda)    
  print(mel_gt.is_cuda)
  print(text.is_cuda)
  
  </code></pre>
  <p>Can you guys figure out what's the problem?? I need big big help,,</p>