(module, *args, **kwargs)
| 84 | |
| 85 | @staticmethod |
| 86 | def _hook_rss_memory_pre_forward(module, *args, **kwargs): |
| 87 | try: |
| 88 | import psutil |
| 89 | except (ImportError): |
| 90 | raise ImportError("You need to install psutil (pip install psutil) to use memory tracing.") |
| 91 | |
| 92 | process = psutil.Process(os.getpid()) |
| 93 | mem = process.memory_info() |
| 94 | module.mem_rss_pre_forward = mem.rss |
| 95 | return None |
| 96 | |
| 97 | @staticmethod |
| 98 | def _hook_rss_memory_post_forward(module, *args, **kwargs): |
nothing calls this directly
no outgoing calls
no test coverage detected