提交 1e7bd758 编写于 作者: Benny Chen's avatar Benny Chen 提交者: Facebook Github Bot

Query caffe2 operator stats for detailed execution info (#20924)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20924

I found a python3 bug for deserializing caffe2 code. The exception thrown is Unicode related error instead of just decode error, and we need to catch that as well

Reviewed By: ipiszy

Differential Revision: D15293221

fbshipit-source-id: 29820800d1b4cbe5bf3f5a189fe2023e655d0508
上级 d9eec4ef
...@@ -205,7 +205,7 @@ def TryReadProtoWithClass(cls, s): ...@@ -205,7 +205,7 @@ def TryReadProtoWithClass(cls, s):
try: try:
text_format.Parse(s, obj) text_format.Parse(s, obj)
return obj return obj
except text_format.ParseError: except (text_format.ParseError, UnicodeDecodeError):
obj.ParseFromString(s) obj.ParseFromString(s)
return obj return obj
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册