Get balanced weights per class for cross-entropy loss.
y_data – Numpy array of output class labels.
A tensor with class weights.
torch.tensor
tensor