Skip to content

Commit

Permalink
model_dump: Accept variable-length debug info (pytorch#57660)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#57660

Ignore trailing elements so we're compatible with both old and new
models.

Test Plan: Dumped and old model.  Unit test.

Reviewed By: malfet

Differential Revision: D28531391

Pulled By: dreiss

fbshipit-source-id: 197a55ab0e6a7d8e25cbee83852e194afacc988e
  • Loading branch information
dreiss authored and facebook-github-bot committed May 19, 2021
1 parent ab1fdbe commit a913754
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions torch/utils/model_dump/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ def ist(s):

code_parts = []
for di, di_next in zip(debug_info, debug_info[1:]):
# accounting for source range serialization format change
start, source_range, _ = di
start, source_range, *_ = di
end = di_next[0]
assert end > start
source, s_start, s_end = source_range
Expand Down

0 comments on commit a913754

Please sign in to comment.