projects
/
pytorch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3814647
)
Update.
author
François Fleuret
<francois@fleuret.org>
Mon, 5 Dec 2022 08:27:21 +0000
(09:27 +0100)
committer
François Fleuret
<francois@fleuret.org>
Mon, 5 Dec 2022 08:27:21 +0000
(09:27 +0100)
stack.py
patch
|
blob
|
history
diff --git
a/stack.py
b/stack.py
index
0838bee
..
544306c
100755
(executable)
--- a/
stack.py
+++ b/
stack.py
@@
-10,6
+10,11
@@
from torch import Tensor
import sys
def exception_hook(exc_type, exc_value, tb):
+ r'''Hacks the call stack message in case of RuntimeError to show all
+ the local variables, and indicate for every tensor its shape,
+ dtype and device.
+
+ '''
repr_orig=Tensor.__repr__
Tensor.__repr__=lambda x: f'{x.size()}:{x.dtype}:{x.device}'