(self, predict, target, weight=None)
return self.criterion(predict, target)
Args:
                predict:(n, c, h, w)
                target:(n, h, w)
                weight (Tensor, optional): a manual rescaling weight given to each class.
                                           If given, has to be a Tensor of size "nclasses"
Args:
                predict:(n, c, h, w)
                target:(n, h, w)
                weight (Tensor, optional): a manual rescaling weight given to each class.
                                           If given, has to be a Tensor of size "nclasses"
Args : predict : ( n c h w ) target : ( n h w ) weight ( Tensor optional ) : a manual rescaling weight given to each class . If given has to be a Tensor of size nclasses
def forward(self, predict, target, weight=None):
        """
            Args:
                predict:(n, c, h, w)
                target:(n, h, w)
                weight (Tensor, optional): a manual rescaling weight given to each class.
                                           If given, has to be a Tensor of size "nclasses"
        """
        assert not target.requires_grad

        input_prob = F.softmax(predict, 1)
        target = self.generate_new_target(input_prob, target)
        return self.criterion(predict, target)
def forward ( self , predict , target , weight = None ) : assert not target . requires_grad input_prob = F . softmax ( predict , 1 ) target = self . generate_new_target ( input_prob , target ) return self . criterion ( predict , target )