projects
/
pytorch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
cfa42f2
)
Update.
author
François Fleuret
<francois@fleuret.org>
Mon, 5 Dec 2022 08:42:48 +0000
(09:42 +0100)
committer
François Fleuret
<francois@fleuret.org>
Mon, 5 Dec 2022 08:42:48 +0000
(09:42 +0100)
tensorstack.py
patch
|
blob
|
history
diff --git
a/tensorstack.py
b/tensorstack.py
index
f511547
..
8360f9b
100755
(executable)
--- a/
tensorstack.py
+++ b/
tensorstack.py
@@
-20,17
+20,18
@@
def exception_hook(exc_type, exc_value, tb):
Tensor.__repr__=lambda x: f'{x.size()}:{x.dtype}:{x.device}'
while tb:
Tensor.__repr__=lambda x: f'{x.size()}:{x.dtype}:{x.device}'
while tb:
- print('--------------------------------------------------')
+ print('--------------------------------------------------
\n
')
filename = tb.tb_frame.f_code.co_filename
name = tb.tb_frame.f_code.co_name
line_no = tb.tb_lineno
print(f' File "{filename}", line {line_no}, in {name}')
filename = tb.tb_frame.f_code.co_filename
name = tb.tb_frame.f_code.co_name
line_no = tb.tb_lineno
print(f' File "{filename}", line {line_no}, in {name}')
- print(open(filename, 'r').readlines()[line_no-1]
, end=''
)
+ print(open(filename, 'r').readlines()[line_no-1])
if exc_type is RuntimeError:
for n,v in tb.tb_frame.f_locals.items():
print(f' {n} -> {v}')
if exc_type is RuntimeError:
for n,v in tb.tb_frame.f_locals.items():
print(f' {n} -> {v}')
+ print()
tb = tb.tb_next
Tensor.__repr__=repr_orig
tb = tb.tb_next
Tensor.__repr__=repr_orig