We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
ProgressMonitor (Trainer plugin) prints incorrect progress value and percentage
Code to replicate behaviour, extract of [jupyter notebook](https://github.com/recastrodiaz/courses/blob/master/deeplearning1/nbs/lesson1-pytorch.ipynb) In [9]:

```PYTHON
t = trainer.Trainer(model, criterion, optimizer, train_loader)
t.register_plugin(trainer.plugins.ProgressMonitor())
t.register_plugin(trainer.plugins.AccuracyMonitor())
t.register_plugin(trainer.plugins.LossMonitor())
t.register_plugin(trainer.plugins.TimeMonitor())
t.register_plugin(trainer.plugins.Logger(['progress', 'accuracy', 'loss', 'time']))

epochs = 1
t.run(epochs)
```

Prints:
```LOG
progress: 23000/360 (6388.89%)	accuracy: 100.00%  (99.31%)	loss: 0.0058  (0.0368)	time: 705ms    (1249ms)
```

Should print instead:
```
progress: 360/360 (100.00%)	accuracy: 100.00%  (99.31%)	loss: 0.0058  (0.0368)	time: 705ms    (1249ms)
```

I'll send over a PR for this.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `torch/utils/trainer/plugins/progress.py`
Content:
```
1 from .plugin import Plugin
2 
3 
4 class ProgressMonitor(Plugin):
5     stat_name = 'progress'
6 
7     def __init__(self):
8         super(ProgressMonitor, self).__init__([(1, 'iteration'), (1, 'epoch')])
9 
10     def register(self, trainer):
11         self.trainer = trainer
12         stats = self.trainer.stats.setdefault(self.stat_name, {})
13         stats['samples_used'] = 0
14         stats['epoch_size'] = len(trainer.dataset)
15         stats['log_iter_fields'] = [
16             '{samples_used}/{epoch_size}',
17             '({percent:.2f}%)'
18         ]
19 
20     def iteration(self, iteration, input, *args):
21         stats = self.trainer.stats.setdefault(self.stat_name, {})
22         stats['samples_used'] += input.size(0)
23         stats['percent'] = 100. * stats['samples_used'] / stats['epoch_size']
24 
25     def epoch(self, *args):
26         stats = self.trainer.stats.setdefault(self.stat_name, {})
27         stats['samples_used'] = 0
28         stats['percent'] = 0
29
```
--- 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()

```

diff --git a/torch/utils/trainer/plugins/progress.py b/torch/utils/trainer/plugins/progress.py
--- a/torch/utils/trainer/plugins/progress.py
+++ b/torch/utils/trainer/plugins/progress.py
@@ -19,7 +19,7 @@
 
     def iteration(self, iteration, input, *args):
         stats = self.trainer.stats.setdefault(self.stat_name, {})
-        stats['samples_used'] += input.size(0)
+        stats['samples_used'] += 1
         stats['percent'] = 100. * stats['samples_used'] / stats['epoch_size']
 
     def epoch(self, *args):

{"golden_diff": "diff --git a/torch/utils/trainer/plugins/progress.py b/torch/utils/trainer/plugins/progress.py\n--- a/torch/utils/trainer/plugins/progress.py\n+++ b/torch/utils/trainer/plugins/progress.py\n@@ -19,7 +19,7 @@\n \n     def iteration(self, iteration, input, *args):\n         stats = self.trainer.stats.setdefault(self.stat_name, {})\n-        stats['samples_used'] += input.size(0)\n+        stats['samples_used'] += 1\n         stats['percent'] = 100. * stats['samples_used'] / stats['epoch_size']\n \n     def epoch(self, *args):\n", "issue": "ProgressMonitor (Trainer plugin) prints incorrect progress value and percentage\nCode to replicate behaviour, extract of [jupyter notebook](https://github.com/recastrodiaz/courses/blob/master/deeplearning1/nbs/lesson1-pytorch.ipynb) In [9]:\r\n\r\n```PYTHON\r\nt = trainer.Trainer(model, criterion, optimizer, train_loader)\r\nt.register_plugin(trainer.plugins.ProgressMonitor())\r\nt.register_plugin(trainer.plugins.AccuracyMonitor())\r\nt.register_plugin(trainer.plugins.LossMonitor())\r\nt.register_plugin(trainer.plugins.TimeMonitor())\r\nt.register_plugin(trainer.plugins.Logger(['progress', 'accuracy', 'loss', 'time']))\r\n\r\nepochs = 1\r\nt.run(epochs)\r\n```\r\n\r\nPrints:\r\n```LOG\r\nprogress: 23000/360 (6388.89%)\taccuracy: 100.00%  (99.31%)\tloss: 0.0058  (0.0368)\ttime: 705ms    (1249ms)\r\n```\r\n\r\nShould print instead:\r\n```\r\nprogress: 360/360 (100.00%)\taccuracy: 100.00%  (99.31%)\tloss: 0.0058  (0.0368)\ttime: 705ms    (1249ms)\r\n```\r\n\r\nI'll send over a PR for this.\n", "before_files": [{"content": "from .plugin import Plugin\n\n\nclass ProgressMonitor(Plugin):\n    stat_name = 'progress'\n\n    def __init__(self):\n        super(ProgressMonitor, self).__init__([(1, 'iteration'), (1, 'epoch')])\n\n    def register(self, trainer):\n        self.trainer = trainer\n        stats = self.trainer.stats.setdefault(self.stat_name, {})\n        stats['samples_used'] = 0\n        stats['epoch_size'] = len(trainer.dataset)\n        stats['log_iter_fields'] = [\n            '{samples_used}/{epoch_size}',\n            '({percent:.2f}%)'\n        ]\n\n    def iteration(self, iteration, input, *args):\n        stats = self.trainer.stats.setdefault(self.stat_name, {})\n        stats['samples_used'] += input.size(0)\n        stats['percent'] = 100. * stats['samples_used'] / stats['epoch_size']\n\n    def epoch(self, *args):\n        stats = self.trainer.stats.setdefault(self.stat_name, {})\n        stats['samples_used'] = 0\n        stats['percent'] = 0\n", "path": "torch/utils/trainer/plugins/progress.py"}], "after_files": [{"content": "from .plugin import Plugin\n\n\nclass ProgressMonitor(Plugin):\n    stat_name = 'progress'\n\n    def __init__(self):\n        super(ProgressMonitor, self).__init__([(1, 'iteration'), (1, 'epoch')])\n\n    def register(self, trainer):\n        self.trainer = trainer\n        stats = self.trainer.stats.setdefault(self.stat_name, {})\n        stats['samples_used'] = 0\n        stats['epoch_size'] = len(trainer.dataset)\n        stats['log_iter_fields'] = [\n            '{samples_used}/{epoch_size}',\n            '({percent:.2f}%)'\n        ]\n\n    def iteration(self, iteration, input, *args):\n        stats = self.trainer.stats.setdefault(self.stat_name, {})\n        stats['samples_used'] += 1\n        stats['percent'] = 100. * stats['samples_used'] / stats['epoch_size']\n\n    def epoch(self, *args):\n        stats = self.trainer.stats.setdefault(self.stat_name, {})\n        stats['samples_used'] = 0\n        stats['percent'] = 0\n", "path": "torch/utils/trainer/plugins/progress.py"}]}