https://github.com/xinyi-code/NLP-Loss-Pytorch/blob/ed42aa29014735dc937d5f34bf690e8ed596e735/unbalanced_loss/dice_loss.py#L98 the letter 's' is redundant >>> it should be "dice_loss *= self.weight[i]" instead of "dice_loss *= self.weights[i]"