| import sys | |
| import platform | |
| import torch | |
| import pandas as pd | |
| def showDeviceInfo(): | |
| has_gpu = torch.cuda.is_available() | |
| has_mps = torch.backends.mps.is_built() | |
| device = "mps" if has_mps \ | |
| else "cuda" if has_gpu else "cpu" | |
| print(f"Python Platform: {platform.platform()}") | |
| print(f"PyTorch Version: {torch.__version__}") | |
| print() | |
| print(f"Python {sys.version}") | |
| print(f"Pandas {pd.__version__}") | |
| print("GPU is", "available" if has_gpu else "NOT AVAILABLE") | |
| print("MPS (Apple Metal) is", "AVAILABLE" if has_mps else "NOT AVAILABLE") | |
| print(f"Target device is {device}") | |