How to change a function to be used in cuda? RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same

I am using the tutorial on training a classifier for cifar10
So in this tutorial and other places we can do net = net.to(device) to use the it in cuda version

Lets say i have:


class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.conv1 = nn.Conv2d(3, 6, 5,padding= 5/2)
        self.pool = nn.MaxPool2d(2, 2)
        self.pool = nn.MaxPool2d(2, 2)
        self.conv2 = nn.Conv2d(6, 16, 5,padding= 5/2)
        
        self.fc1 = nn.Linear(16 * 32 * 32, 120)
        self.fc2 = nn.Linear(120, 84)
        self.fc3 = nn.Linear(84, 10)

    def FunctionIdesigned(self, a,b):
        blabblab
        return hhh
    
    def FunctionIdesigned2(self, aa,bb):
        Here I am using FunctionIdesigned also
        blablabblab
        
        return hh
    def forward(self, x):
        y = FunctionIdesigned2(x,GaussianKernel(3,0.5))

        
        x = self.pool(F.relu(self.conv1(x)))
        x = F.relu(self.conv1(x))
        x = self.pool(F.relu(self.conv2(x)))
        x = F.relu(self.conv2(x))

        

        x = x.view(-1, 16 * 32 * 32)
        x = F.relu(self.fc1(x))
        x = F.relu(self.fc2(x))
        x = self.fc3(x)
        
        return x


net = Net()
net = net.to(device)

when i wanna use the net function it still gives me error that FunctionIdesigned2 is not in cuda.
is there any way to use to(device) to fix it or i should use .cuda manually inside the function?

Error:
RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same

@isalirezag Have you been able to fix this? I am trying to get my Net to GPU.

Could you post your training loop so we can take a look?. Its likely that the bug is there.