TypeError: 'torch.dtype' object is not callable. how to call this function?
How to call this torch.dtype? because here the error shows it's not callable. before I used floatTensor and it shows the error like this can't convert np.ndarray of type numpy.object_ and now I using float64 it showing the error 'torch.dtype' object is not callable. please help with this issue.
import torch
    a = torch.cuda.is_available()
    b = torch.cuda.current_device()
    c = torch.cuda.get_device_name()
    d = torch.cuda.memory_reserved()
    e = torch.cuda.memory_allocated()
    var1 = torch.FloatTensor([1.0,2.0,3.0]).cuda()
    var1
    a1 = var1.device
    import pandas as pd
    df = pd.read_csv('diabetes.csv')
    df.head()
    b1 = 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;)
    b2 = df.head()
    b3 = sns.pairplot(df,hue=&quot;Outcome&quot;)
    
    X=df.drop('Outcome',axis=1).values
    y=df['Outcome'].values
    
    from sklearn.model_selection import train_test_split
    
    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
    
    X_train=torch.FloatTensor(X_train).cuda()
    X_test=torch.FloatTensor(X_test).cuda()
    y_train=torch.float64(y_train).cuda()

this is the error:
 C:\Users\vinot\.conda\envs\python21\python.exe D:/python/python_work/pythonProject/diabetes.py
    Traceback (most recent call last):
      File &quot;D:/python/python_work/pythonProject/diabetes.py&quot;, line 35, in &lt;module&gt;
        y_train=torch.float64(y_train).cuda()
    TypeError: 'torch.dtype' object is not callable
    
    Process finished with exit code 1


torch.float64 is a dtype object and not a function so it cannot be called.
To make it into a double float (or at least to make sure it is), I would instead call:
y_train = torch.from_numpy(y_train).double().cuda()

