Well, I see two possibilities:

you define a custom loss function, providing weights for each sample as you like.
you repeat samples in your training set, which will result in more frequent samples having a higher weight in your loss.

As far as I know, there is no other way to do this in PyTorch, but maybe I’m wrong…