Hello Clement!



 Bled_Clement:

I think it could be too much to share everything needed to run a test of this module


I’m suggesting that you post a test script just for your log-exp
calculation.
Something like:
import torch

sample_tensor =  something_like_torch_randn()

original_result = torch.log (1 + torch.exp (sample_tensor))

new_result = something_with_torch_logsumexp (sample_tensor)

This should be a complete, runnable script (that is simple,
totally self-contained, and doesn’t depend on any of your
other modules or outside data).  If your new_result doesn’t
run, we can see the errors and make suggestions.  If it does
run, but doesn’t give the right answer, we can look for the
cause of the discrepancy.
(Your original_result will be our baseline for comparison.
It should be correct for moderate tensor values.  It’s okay if it
becomes inf for large tensor values because that’s the issue
we are trying to address.)
Best.
K. Frank