im trying to implement my loss function but having a problem. i tried to implement many different variable types such as long/float/int for ‘‘int’ object is not callable’’ . i cant understand where the problem is caused
labels.size = torch.Size([4, 11, 224, 224] , <class 'torch.Tensor'>
output.size = ([4, 11, 224, 224]) ,<class 'torch.Tensor'>

My Custom Loss Function
DSC = 2|XnY|/(|x|+|y|)

class Dice_Loss(torch.nn.Module):
    
    def __init__(self):
        super(Dice_Loss,self).__init__()
        
    def forward(self,x,y):
        x = x.view(-1,dtype = torch.float)
        y = y.view(-1,dtype = torch.float)
        square_x = torch.sqrt(torch.square(x))
        square_y = torch.sqrt(torch.square(y))
        intersection = 2*torch.mul(square_x,square_y)
        #multipication = torch.sum(torch.sqrt(torch.square(x)),torch.sqrt(torch.square(y)))
        multipication = square_x.add(square_y)
        return (intersection/multipication)

apply for
dice_loss = Dice_Loss.apply or Dice_Loss()

Traceback
TypeError                                 Traceback (most recent call last)
<ipython-input-47-04945a48ff0c> in <module>()
     14     print(output.size())
     15     print(labels.size())
---> 16     loss_dice = dice_loss(labels,output)
     17     loss_dice.backward()
     18     optim.step()

TypeError: 'int' object is not callable