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:
d37e52d
)
Update.
author
François Fleuret
<francois@fleuret.org>
Mon, 28 Nov 2022 12:23:19 +0000
(13:23 +0100)
committer
François Fleuret
<francois@fleuret.org>
Mon, 28 Nov 2022 12:23:19 +0000
(13:23 +0100)
stack.py
patch
|
blob
|
history
diff --git
a/stack.py
b/stack.py
index
27de204
..
453e9ed
100755
(executable)
--- a/
stack.py
+++ b/
stack.py
@@
-11,13
+11,13
@@
import sys
def exception_hook(exc_type, exc_value, tb):
def exception_hook(exc_type, exc_value, tb):
- tb = tb.tb_next
+
#
tb = tb.tb_next
while tb:
while tb:
- #
x=tb.tb_frame
.f_code
+ #
x=tb.tb_frame #
.f_code
# for field in dir(x):
# print(f'@@@ {field} {getattr(x, field)}')
# for field in dir(x):
# print(f'@@@ {field} {getattr(x, field)}')
-
+ print('--------------------------------------------------')
filename = tb.tb_frame.f_code.co_filename
name = tb.tb_frame.f_code.co_name
line_no = tb.tb_lineno
filename = tb.tb_frame.f_code.co_filename
name = tb.tb_frame.f_code.co_name
line_no = tb.tb_lineno
@@
-28,7
+28,7
@@
def exception_hook(exc_type, exc_value, tb):
for n,v in local_vars.items():
if is_tensor(v):
for n,v in local_vars.items():
if is_tensor(v):
- print(f' {n} -> {
v.size(
)}:{v.dtype}:{v.device}')
+ print(f' {n} -> {
tuple(v.size()
)}:{v.dtype}:{v.device}')
else:
print(f' {n} -> {v}')
else:
print(f' {n} -> {v}')
@@
-51,8
+51,9
@@
if __name__ == '__main__':
c=b+b
dummy(a,c)
c=b+b
dummy(a,c)
- m=torch.randn(2,3)
- x=torch.randn(3)
- blah(m,x)
- blah(x,m)
+ mmm=torch.randn(2,3)
+ xxx=torch.randn(3)
+ #print(xxx@mmm)
+ blah(mmm,xxx)
+ blah(xxx,mmm)