🐛 Bug description

Environment
- PyTorch Version :1.10.1
- Ignite Version ():0.4.8
- OS : Ubuntu
- How you installed Ignite (
conda, pip, source):
- Python version: 3.9
- Any other relevant information:
If the previous batch and the current batch are different then it throws the error. Attaching the screen shot of error.
Screenshot of the basic code is also attached.
