- r'''Hacks the call stack message in case of RuntimeError to show all
- the local variables, and indicate for every tensor its shape,
+ r'''Hacks the call stack message to show all the local variables in
+ case of RuntimeError or ValueError, and prints tensors as shape,
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}')