You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `torch.autograd` API now includes a memory profiler that lets you inspect the cost of different operators inside your CPU and GPU models. There are two modes implemented at the moment - CPU-only using [profile](https://pytorch.org/docs/master/autograd.html#torch.autograd.profiler.profile) and nvprof based (registers both CPU and GPU activity) using [emit_nvtx](https://pytorch.org/docs/master/autograd.html#torch.autograd.profiler.emit_nvtx).
56
+
The `torch.autograd.profiler` API now includes a memory profiler that lets you inspect the tensor memory cost of different operators inside your CPU and GPU models.
57
57
58
58
Here is an example usage of the API:
59
59
60
60
```python
61
-
x = torch.randn((1, 1), requires_grad=True)
62
-
with torch.autograd.profiler.profile(profile_memory=True) as prof:
63
-
for _ inrange(100): # any normal python code, really!
0 commit comments