Which PyTorch version are you using? If not the latest one, could you update and rerun the code again?
If one backend detects this error, it should be raised by all backends, so it might be an internal bug.