The documentation also says:
weight (Tensor, optional) – a manual rescaling weight given to the loss of each batch element. If given, has to be a Tensor of size “nbatch”
So, the weight vector works on the batch level and not the per-class samples level, or, I am missing something here?