If torch.__version__ returns 1.7.1, I guess you might have multiple PyTorch installations in the current environment and your kernel picks the 1.7.1 one.
Could you either uninstall other PyTorch installations or create a new environment and install the nightly there?