prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  torch.div() (1.6.0) does not have 'rounding_mode' parameter
  According to the torch 1.6.0 here: https://pytorch.org/docs/1.6.0/generated/torch.div.html?highlight=torch%20div#torch.div
  there is no 'rounding_mode' parameter. 
  
  But in translator:
  https://github.com/OpenNMT/OpenNMT-py/blob/0f411ce11a83b18c0223ac94ccc11a35403763df/onmt/translate/beam_search.py#L282
  
  That's why I receive this error:
  ```
  onmt_translate -model ./../output/test/nmt/f0/run/model_step_100.pt -src ./../output/test/nmt/f0/src-test.txt -output ./../output/test/nmt/f0/test.epoch100.pred.csv -gpu 0 --min_length 2 -verbose 
  [2022-09-15 20:32:19,980 INFO] Translating shard 0.
  Traceback (most recent call last):
    File "c:\programdata\anaconda3\envs\nuecg\lib\runpy.py", line 193, in _run_module_as_main
      "__main__", mod_spec)
    File "c:\programdata\anaconda3\envs\nuecg\lib\runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "C:\ProgramData\Anaconda3\envs\nuecg\Scripts\onmt_translate.exe\__main__.py", line 7, in <module>
    File "c:\programdata\anaconda3\envs\nuecg\lib\site-packages\onmt\bin\translate.py", line 54, in main
      translate(opt)
    File "c:\programdata\anaconda3\envs\nuecg\lib\site-packages\onmt\bin\translate.py", line 38, in translate
      align_debug=opt.align_debug
    File "c:\programdata\anaconda3\envs\nuecg\lib\site-packages\onmt\translate\translator.py", line 440, in translate
      phrase_table=phrase_table)
    File "c:\programdata\anaconda3\envs\nuecg\lib\site-packages\onmt\translate\translator.py", line 487, in _translate
      batch, data.src_vocabs, attn_debug
    File "c:\programdata\anaconda3\envs\nuecg\lib\site-packages\onmt\translate\translator.py", line 861, in translate_batch
      batch, src_vocabs, decode_strategy
    File "c:\programdata\anaconda3\envs\nuecg\lib\site-packages\onmt\translate\translator.py", line 947, in _translate_batch_with_strategy
      decode_strategy.advance(log_probs, attn)
    File "c:\programdata\anaconda3\envs\nuecg\lib\site-packages\onmt\translate\beam_search.py", line 283, in advance
      rounding_mode='trunc')
  TypeError: div() got an unexpected keyword argument 'rounding_mode'
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `setup.py`
  Content:
  ```
  1 #!/usr/bin/env python
  2 from setuptools import setup, find_packages
  3 from os import path
  4 
  5 this_directory = path.abspath(path.dirname(__file__))
  6 with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
  7     long_description = f.read()
  8 
  9 setup(
  10     name='OpenNMT-py',
  11     description='A python implementation of OpenNMT',
  12     long_description=long_description,
  13     long_description_content_type='text/markdown',
  14     version='2.3.0',
  15     packages=find_packages(),
  16     project_urls={
  17         "Documentation": "http://opennmt.net/OpenNMT-py/",
  18         "Forum": "http://forum.opennmt.net/",
  19         "Gitter": "https://gitter.im/OpenNMT/OpenNMT-py",
  20         "Source": "https://github.com/OpenNMT/OpenNMT-py/"
  21     },
  22     python_requires=">=3.5",
  23     install_requires=[
  24         "torch>=1.6.0",
  25         "torchtext==0.5.0",
  26         "configargparse",
  27         "tensorboard>=2.3",
  28         "flask",
  29         "waitress",
  30         "pyonmttok>=1.23,<2",
  31         "pyyaml",
  32         "sacrebleu"
  33     ],
  34     entry_points={
  35         "console_scripts": [
  36             "onmt_server=onmt.bin.server:main",
  37             "onmt_train=onmt.bin.train:main",
  38             "onmt_translate=onmt.bin.translate:main",
  39             "onmt_translate_dynamic=onmt.bin.translate_dynamic:main",
  40             "onmt_release_model=onmt.bin.release_model:main",
  41             "onmt_average_models=onmt.bin.average_models:main",
  42             "onmt_build_vocab=onmt.bin.build_vocab:main"
  43         ],
  44     }
  45 )
  46
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -21,7 +21,7 @@
       },
       python_requires=">=3.5",
       install_requires=[
  -        "torch>=1.6.0",
  +        "torch>=1.9.0",
           "torchtext==0.5.0",
           "configargparse",
           "tensorboard>=2.3",
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -21,7 +21,7 @@\n     },\n     python_requires=\">=3.5\",\n     install_requires=[\n-        \"torch>=1.6.0\",\n+        \"torch>=1.9.0\",\n         \"torchtext==0.5.0\",\n         \"configargparse\",\n         \"tensorboard>=2.3\",\n", "issue": "torch.div() (1.6.0) does not have 'rounding_mode' parameter\nAccording to the torch 1.6.0 here: https://pytorch.org/docs/1.6.0/generated/torch.div.html?highlight=torch%20div#torch.div\r\nthere is no 'rounding_mode' parameter. \r\n\r\nBut in translator:\r\nhttps://github.com/OpenNMT/OpenNMT-py/blob/0f411ce11a83b18c0223ac94ccc11a35403763df/onmt/translate/beam_search.py#L282\r\n\r\nThat's why I receive this error:\r\n```\r\nonmt_translate -model ./../output/test/nmt/f0/run/model_step_100.pt -src ./../output/test/nmt/f0/src-test.txt -output ./../output/test/nmt/f0/test.epoch100.pred.csv -gpu 0 --min_length 2 -verbose \r\n[2022-09-15 20:32:19,980 INFO] Translating shard 0.\r\nTraceback (most recent call last):\r\n  File \"c:\\programdata\\anaconda3\\envs\\nuecg\\lib\\runpy.py\", line 193, in _run_module_as_main\r\n    \"__main__\", mod_spec)\r\n  File \"c:\\programdata\\anaconda3\\envs\\nuecg\\lib\\runpy.py\", line 85, in _run_code\r\n    exec(code, run_globals)\r\n  File \"C:\\ProgramData\\Anaconda3\\envs\\nuecg\\Scripts\\onmt_translate.exe\\__main__.py\", line 7, in <module>\r\n  File \"c:\\programdata\\anaconda3\\envs\\nuecg\\lib\\site-packages\\onmt\\bin\\translate.py\", line 54, in main\r\n    translate(opt)\r\n  File \"c:\\programdata\\anaconda3\\envs\\nuecg\\lib\\site-packages\\onmt\\bin\\translate.py\", line 38, in translate\r\n    align_debug=opt.align_debug\r\n  File \"c:\\programdata\\anaconda3\\envs\\nuecg\\lib\\site-packages\\onmt\\translate\\translator.py\", line 440, in translate\r\n    phrase_table=phrase_table)\r\n  File \"c:\\programdata\\anaconda3\\envs\\nuecg\\lib\\site-packages\\onmt\\translate\\translator.py\", line 487, in _translate\r\n    batch, data.src_vocabs, attn_debug\r\n  File \"c:\\programdata\\anaconda3\\envs\\nuecg\\lib\\site-packages\\onmt\\translate\\translator.py\", line 861, in translate_batch\r\n    batch, src_vocabs, decode_strategy\r\n  File \"c:\\programdata\\anaconda3\\envs\\nuecg\\lib\\site-packages\\onmt\\translate\\translator.py\", line 947, in _translate_batch_with_strategy\r\n    decode_strategy.advance(log_probs, attn)\r\n  File \"c:\\programdata\\anaconda3\\envs\\nuecg\\lib\\site-packages\\onmt\\translate\\beam_search.py\", line 283, in advance\r\n    rounding_mode='trunc')\r\nTypeError: div() got an unexpected keyword argument 'rounding_mode'\r\n```\n", "before_files": [{"content": "#!/usr/bin/env python\nfrom setuptools import setup, find_packages\nfrom os import path\n\nthis_directory = path.abspath(path.dirname(__file__))\nwith open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:\n    long_description = f.read()\n\nsetup(\n    name='OpenNMT-py',\n    description='A python implementation of OpenNMT',\n    long_description=long_description,\n    long_description_content_type='text/markdown',\n    version='2.3.0',\n    packages=find_packages(),\n    project_urls={\n        \"Documentation\": \"http://opennmt.net/OpenNMT-py/\",\n        \"Forum\": \"http://forum.opennmt.net/\",\n        \"Gitter\": \"https://gitter.im/OpenNMT/OpenNMT-py\",\n        \"Source\": \"https://github.com/OpenNMT/OpenNMT-py/\"\n    },\n    python_requires=\">=3.5\",\n    install_requires=[\n        \"torch>=1.6.0\",\n        \"torchtext==0.5.0\",\n        \"configargparse\",\n        \"tensorboard>=2.3\",\n        \"flask\",\n        \"waitress\",\n        \"pyonmttok>=1.23,<2\",\n        \"pyyaml\",\n        \"sacrebleu\"\n    ],\n    entry_points={\n        \"console_scripts\": [\n            \"onmt_server=onmt.bin.server:main\",\n            \"onmt_train=onmt.bin.train:main\",\n            \"onmt_translate=onmt.bin.translate:main\",\n            \"onmt_translate_dynamic=onmt.bin.translate_dynamic:main\",\n            \"onmt_release_model=onmt.bin.release_model:main\",\n            \"onmt_average_models=onmt.bin.average_models:main\",\n            \"onmt_build_vocab=onmt.bin.build_vocab:main\"\n        ],\n    }\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\nfrom setuptools import setup, find_packages\nfrom os import path\n\nthis_directory = path.abspath(path.dirname(__file__))\nwith open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:\n    long_description = f.read()\n\nsetup(\n    name='OpenNMT-py',\n    description='A python implementation of OpenNMT',\n    long_description=long_description,\n    long_description_content_type='text/markdown',\n    version='2.3.0',\n    packages=find_packages(),\n    project_urls={\n        \"Documentation\": \"http://opennmt.net/OpenNMT-py/\",\n        \"Forum\": \"http://forum.opennmt.net/\",\n        \"Gitter\": \"https://gitter.im/OpenNMT/OpenNMT-py\",\n        \"Source\": \"https://github.com/OpenNMT/OpenNMT-py/\"\n    },\n    python_requires=\">=3.5\",\n    install_requires=[\n        \"torch>=1.9.0\",\n        \"torchtext==0.5.0\",\n        \"configargparse\",\n        \"tensorboard>=2.3\",\n        \"flask\",\n        \"waitress\",\n        \"pyonmttok>=1.23,<2\",\n        \"pyyaml\",\n        \"sacrebleu\"\n    ],\n    entry_points={\n        \"console_scripts\": [\n            \"onmt_server=onmt.bin.server:main\",\n            \"onmt_train=onmt.bin.train:main\",\n            \"onmt_translate=onmt.bin.translate:main\",\n            \"onmt_translate_dynamic=onmt.bin.translate_dynamic:main\",\n            \"onmt_release_model=onmt.bin.release_model:main\",\n            \"onmt_average_models=onmt.bin.average_models:main\",\n            \"onmt_build_vocab=onmt.bin.build_vocab:main\"\n        ],\n    }\n)\n", "path": "setup.py"}]}