Lewis_Liu:

at the beginning everything is okay. then I noticed when upper_bound exceeds 32768, the process hangs between the first line and second line


This sounds like a int16_t overflow bug (or that might hit some different branch). Could you please create an issue in pytorch repo 4? Thanks!