My custom loss never goes backward

Thank you for your insight! I am new to PyTorch and didn’t realize argmax is the root cause of the problem and have been doubting if my dictionary lookups broke the connectivity since they were not wrapped in Variables.

I read your answer to another similar problem (link here), would you mind providing some further suggestions/solutions for work around this argmax issue and make my backprop working? Thanks!