ptrblck:

.div(inputTensor[n][m], torch.sum(inputTensor[n]))


Hey,
thanks a lot for your help.
I tried your code. The performance has improved.
However, I have found that I can use the Softmax function for this just as well and the result is the same. So now I just use the Softmax function from Pytorch for my problem.
Many greetings