Could you post a minimal code snippet to reproduce this error as well as the output of python -m torch.utils.collect_env, please?
In case you are using an older PyTorch release, could you update to the latest one and check, if you are still facing this error?