First, it must also turn Tensor weight of cuda format;
Then, the class_weight as a function of the cross-entropy parameter values corresponding to the input.
class_weight = torch.FloatTensor([0.13859937, 0.5821059, 0.63871904, 2.30220396, 7.1588294, 0]).cuda()