Thanks for the response @ptrblck
At least now I know how to tackle the first issue. Also, I created the issue regarding the bug you’ve found enumerate(..., start=idx) is not working correctly while scripting · Issue #67142 · pytorch/pytorch · GitHub 1
Feel free to continue our discussion on Github.