This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| import matplotlib.pyplot as plt | |
| # ── Environment diagnostics ─────────────────────────────────────────────────── | |
| # Print the runtime environment so results are reproducible and hardware-aware. | |
| print(f"PyTorch version: {torch.__version__}") | |
| print(f"CUDA available: {torch.cuda.is_available()}") | |
| print(f"MPS available: {torch.backends.mps.is_available()}") | |
| print(f"MPS built: {torch.backends.mps.is_built()}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Indent(): | |
| def __init__(self): | |
| self.level = 0 | |
| def __enter__(self): | |
| self.level+=1 | |
| return self | |
| def __exit__(self, *exc): | |
| self.level -= 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| *@file | |
| *@author Nisarg Suthar(nisargsuthar0@gmail.com) | |
| *@brief | |
| *@version 0.1 | |
| *@date | |
| *@copyright Copyright (c) 2021 | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int start_up() { | |
| ios_base::sync_with_stdio(false); | |
| cin.tie(NULL); | |
| return 0; | |
| } | |
| int static r = start_up(); | |
| #define endl '\n'; |