Error when I used Torchscript: Python builtin <built-in function next> is currently not supported in Torchscript

Hello I have a problem when I would like compile my custom model with TorchScript.

My error is:

RuntimeError:
Python builtin <built-in function next> is currently not supported in Torchscript:
  File "file.py", line 152
        seq_iter = enumerate(scores)
        _, inivalues = next(seq_iter)
                       ~~~~ <--- HERE

TorchScript doesn’t seem to be able to script the next call, so you might want to script the model only assuming that the next call is used in the data loading part of your script.