Thank you @KFrank
but since the weight tensor is
cl_wts = 1./torch.tensor([5., 3.]) = tensor([0.2, 0.333])


Why are you multiplying samples with label =1 by 0.333 (Doesn’t this mean we are giving it more importance , since it is already higher than other class.  Shouldn’t we multiply the samples with lower class with more weights [in our case 0.333 is more and it should be multiplied to lower class and 0.2 for higher class] )
Could you please clarify it
One more thing when i pass the weights
tensor([0.2, 0.333])


does it work like the class_0 will get weight 0.2 and class_1 will get 0.333 and so on ??