Thanks for your reply. The PIL version is 5.1.0. Also the return in the rotate function on my system is different than the one in the link you mentioned.
For me its:
return img.rotate(angle, resample, expand, center, fillcolor=fill)
Just now I uninstalled torch 1.4.0 and reinstalled it, but its the same.