@Keshav.A uninstall PyTorch first, and you can find more detailed install instructions for PyTorch on Jetson Nano in this topic:
If you still are having problems after that, I would recommend trying the l4t-pytorch container which already has PyTorch with CUDA support installed: