-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[JIT] Serialization methods for SourceRange and Source #22178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
[JIT] Serialization methods for SourceRange and Source gh-metadata: pytorch pytorch 22178 gh/jamesr66a/7/head
[JIT] Serialization methods for SourceRange and Source gh-metadata: pytorch pytorch 22178 gh/jamesr66a/7/head
zdevito
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The methods need to be put into a separate compilation unit to avoid bloating the dependency tree for source_range objects, which are widely used.
[JIT] Serialization methods for SourceRange and Source gh-metadata: pytorch pytorch 22178 gh/jamesr66a/7/head
| c10::IValue serialize(const SourceRange& sr) { | ||
| std::vector<c10::IValue> elements = { | ||
| serialize_source(sr.source()), (int64_t)sr.start(), (int64_t)sr.end()}; | ||
| return c10::ivalue::Tuple::create(elements); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: move
| } | ||
| std::vector<c10::IValue> elements{ | ||
| s->text(), s->filename(), (int64_t)s->starting_line_no()}; | ||
| auto serialized = c10::ivalue::Tuple::create(elements); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: move
[JIT] Serialization methods for SourceRange and Source gh-metadata: pytorch pytorch 22178 gh/jamesr66a/7/head
[JIT] Serialization methods for SourceRange and Source gh-metadata: pytorch pytorch 22178 gh/jamesr66a/7/head
[JIT] Serialization methods for SourceRange and Source gh-metadata: pytorch pytorch 22178 gh/jamesr66a/7/head
|
@jamesr66a merged this pull request in e05942c. |
Summary: Pull Request resolved: pytorch#22178 ghimport-source-id: 85ca4d4 Test Plan: Imported from OSS Differential Revision: D15981426 Pulled By: jamesr66a fbshipit-source-id: f81f5ee3b66fc4a0d4a708b8109712b5df9f241a
Stack from ghstack:
Differential Revision: D15981426