"Log of sum over Gaussian likelihood" loss function + DNN

Hi. I have just started working with Pytorch and ML stuff. I have a loss function as below:

I guess I can easily use the nn.GaussianNLLLoss for the first term but do you know how can I implement the second term which is the logarithm of the sum over Gaussian likelihood?