(self, device_index=None)
| 337 | return total if cgroup is None else min(total, cgroup[0]) |
| 338 | |
| 339 | def available_memory(self, device_index=None): |
| 340 | import psutil |
| 341 | available = psutil.virtual_memory().available |
| 342 | cgroup = _cgroup_memory() |
| 343 | if cgroup is None: |
| 344 | return available |
| 345 | limit, cgroup_available = cgroup |
| 346 | return min(available, limit if cgroup_available is None else cgroup_available) |
| 347 | |
| 348 | # Misc |
| 349 | def is_available(self): |
nothing calls this directly
no test coverage detected