I looked  @ https://pytorch.org/docs/stable/_modules/torch/nn/modules/loss.html 52
And I failed to find what I wanted. I basically have multiclass problem, and the targets for each instance is a vector of soft classes.
To be concrete:
nueral net output [0.1, 0.5, 0.4]
correct label [0.2, 0.4, 0.4]
It should be standard in library.
I created my simple Python function to do it, but can anyone please help me wrap it as a proper pytorch loss function?
> def CXE(predicted, target):
>     return -(target * t.log(predicted)).sum(dim=1).mean()

This works for a minibatch. Can I use it in that form? or do I have to make a class out of it and add those things:     @weak_script_method  @weak_module and inherit from somehere?