Commit 13b621d
[DTensor] add __repr__ for CommDebugMode(get_total_count()=) (pytorch#165006)
I just want to print CommDebugMode and know if there is communication. implementing `__repr__` for `print(comm_mode)`
```
comm_mode = CommDebugMode()
with comm_mode:
out = torch.mm(inps, weight)
print(comm_mode)
# CommDebugMode(get_total_counts()=0)
```
Tags:
Pull Request resolved: pytorch#165006
Approved by: https://github.com/anshul-si
ghstack dependencies: pytorch#1650241 parent 01738a3 commit 13b621d
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
0 commit comments