In case you are not using the latest release (1.9.0), could you update PyTorch and rerun the script?
If you are still seeing the issue, could you post an executable code snippet reproducing this error as well as the output of python -m torch.utils.collect_env?