Skip to content

Remove hard file offset reset in load()#3695

Merged
soumith merged 5 commits intopytorch:masterfrom
philippslang:load_offset
Nov 17, 2017
Merged

Remove hard file offset reset in load()#3695
soumith merged 5 commits intopytorch:masterfrom
philippslang:load_offset

Conversation

@philippslang
Copy link
Copy Markdown
Contributor

Slight improvement in file offset handling to be consistent with save() and pickle API, enables loading from arbitrary offsets.

#3694

@soumith
Copy link
Copy Markdown
Collaborator

soumith commented Nov 14, 2017

@pytorchbot test this please

@pytorchbot
Copy link
Copy Markdown
Collaborator

Build finished.

1 similar comment
@pytorchbot
Copy link
Copy Markdown
Collaborator

Build finished.

Comment thread torch/serialization.py Outdated
raise RuntimeError("Unknown saved id type: %s" % saved_id[0])

# try the legacy loader first, which only works if f is a tarfile
# on windows this can return invalid values

This comment was marked as off-topic.

This comment was marked as off-topic.

Copy link
Copy Markdown
Member

@colesbury colesbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@colesbury
Copy link
Copy Markdown
Member

@pytorchbot test this please

@soumith
Copy link
Copy Markdown
Collaborator

soumith commented Nov 17, 2017

@apaszke didn't you want to comment on this PR, you said something was missing?

@soumith
Copy link
Copy Markdown
Collaborator

soumith commented Nov 17, 2017

@pytorchbot test this please

@soumith soumith merged commit c4b0db5 into pytorch:master Nov 17, 2017
@soumith
Copy link
Copy Markdown
Collaborator

soumith commented Nov 17, 2017

thank you @plang85 !

@soumith soumith added the 0.3.1 label Feb 4, 2018
soumith pushed a commit that referenced this pull request Feb 7, 2018
* improved file offset logic

* load offset test

* whitespace

* needless exception handling

* test integer in binary
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
* improved file offset logic

* load offset test

* whitespace

* needless exception handling

* test integer in binary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants