Hi @albanD
Yes it solves the problem!!
Thank you so much for helping!
On the other, I have a couple of question regarding to this.

I have never set  torch.backends.cudnn.enabled=True, so is True the default setting in pytorch?
Why would setting it True resulting this error?
3, In what occasion that setting torch.backends.cudnn.enabled=True would be beneficial?

Update:
So I did one more round of test,
if I set
torch.backends.cudnn.enabled = True
and
torch.backends.cudnn.benchmark = True
no errors were raised too.
But if I set
torch.backends.cudnn.benchmark = False
Then error appeared again.
Previously I was having this impression that the error was caused by the benchmark as it continues to search for the best algorithm. Now I am even more confused.
Once again thank you so much for your help!!!