X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=tensorstack.py;fp=tensorstack.py;h=d7b0d89f4cf97fadee232b427fbe67a728e2e584;hb=fe350ea557cec0d9f2b9e9c6c88dd9633cd2e879;hp=8360f9b9102bff9ba1642a2f458d25130f051db1;hpb=88302d2fbe5ca4adc72f24a78e8d2abb5326418c;p=pytorch.git diff --git a/tensorstack.py b/tensorstack.py index 8360f9b..d7b0d89 100755 --- a/tensorstack.py +++ b/tensorstack.py @@ -27,7 +27,7 @@ def exception_hook(exc_type, exc_value, tb): print(f' File "{filename}", line {line_no}, in {name}') print(open(filename, 'r').readlines()[line_no-1]) - if exc_type is RuntimeError: + if exc_type in { RuntimeError, ValueError }: for n,v in tb.tb_frame.f_locals.items(): print(f' {n} -> {v}')