If you use the functional API, you would avoid recreating the instance of the loss function.
Alternatively, you could pass reduction='none' to the criterion and multiply the loss output manually with your weights. After the multiplication you could take the mean or normalize the loss values as you wish.