mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
net_printer_quick_fix
Summary: To deal with encode failure Reviewed By: azzolini Differential Revision: D5215897 fbshipit-source-id: cf8687706f7e4deaee05b61cd2bfeaff88672fcc
This commit is contained in:
parent
c291c97494
commit
072f4dbefc
|
|
@ -181,7 +181,7 @@ class Printer(Visitor, Text):
|
|||
|
||||
|
||||
def _sanitize_str(s):
|
||||
s = str(s)
|
||||
s = str(s).decode('ascii', errors='ignore')
|
||||
return s if len(s) < 64 else (s[:64] + '...<+len=%d>' % (len(s) - 64))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user