title: TypeError: expected CPU (got CUDA)
body: <pre><code>import torch
  torch.cuda.is_available()
  torch.cuda.current_device()
  torch.cuda.get_device_name(0)
  torch.cuda.memory_reserved()
  torch.cuda.memory_allocated()
  torch.cuda.memory_allocated()
  var1=torch.FloatTensor([1.0,2.0,3.0]).cuda()
  var1
  var1.device
  import pandas as pd
  df=pd.read_csv('diabetes.csv')
  df.head()
  df.isnull().sum()
  
  import seaborn as sns
  import numpy as np
  df['Outcome']=np.where(df['Outcome']==1,&quot;Diabetic&quot;,&quot;No Diabetic&quot;)
  df.head()
  sns.pairplot(df,hue=&quot;Outcome&quot;)
  X=df.drop('Outcome',axis=1).values### independent features
  y=df['Outcome'].values###dependent features
  from sklearn.model_selection import train_test_split
  </code></pre>
  <p>X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.2,random_state=0)
  y_train
  import torch
  import torch.nn as nn
  import torch.nn.functional as F</p>
  <pre><code>X_train=torch.FloatTensor(X_train).cuda()
  X_test=torch.FloatTensor(X_test).cuda()
  y_train=torch.LongTensor(y_train).cuda()
  y_test=torch.LongTensor(y_test).cuda()
  </code></pre>
  <p>when I Run this code I got this error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 24, in &lt;module&gt;
  TypeError: expected CPU (got CUDA)
  </code></pre>
  <p>How to can I solve this error?</p>