Fix nll loss dynamo failure (#120805)
Fix for https://github.com/pytorch/pytorch/issues/119791 Part of dynamo bug bash
Pull Request resolved: https://github.com/pytorch/pytorch/pull/120805
Approved by: https://github.com/Skylion007, https://github.com/zou3519, https://github.com/malfet