Compute the system memory (RAM) usage for the current device (GB). Returns: usage (float): used memory (GB). total (float): total memory (GB).
()
| 62 | |
| 63 | |
| 64 | def cpu_mem_usage(): |
| 65 | """ |
| 66 | Compute the system memory (RAM) usage for the current device (GB). |
| 67 | Returns: |
| 68 | usage (float): used memory (GB). |
| 69 | total (float): total memory (GB). |
| 70 | """ |
| 71 | vram = psutil.virtual_memory() |
| 72 | usage = (vram.total - vram.available) / 1024 ** 3 |
| 73 | total = vram.total / 1024 ** 3 |
| 74 | |
| 75 | return usage, total |
| 76 | |
| 77 | |
| 78 | def _get_model_analysis_input(cfg, use_train_input): |
nothing calls this directly
no outgoing calls
no test coverage detected