-
Notifications
You must be signed in to change notification settings - Fork 65
Auto OpSchema for trace_only functions | feat(op_schema) #674
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
Merged
Merged
Changes from all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
c6505cf
Move version_utils to _internal | chore
justinchuby 268ad8f
Merge `attrs` and `attr_protos` in `IRFunction` | chore(irbuilder)
justinchuby 327a7d6
Auto generate OpSchema for functions | feat
justinchuby 0883d6f
Update base for Update on "Auto generate OpSchema for functions | feat"
justinchuby 95c4ba6
Update on "Auto generate OpSchema for functions | feat"
justinchuby 962c13b
Update base for Update on "Auto generate OpSchema for functions | feat"
justinchuby a353d73
Update on "Auto generate OpSchema for functions | feat"
justinchuby 821821c
Update base for Update on "Auto generate OpSchema for functions | feat"
justinchuby fa16ca5
Update on "Auto generate OpSchema for functions | feat"
justinchuby 6b9106b
Update base for Update on "Auto generate OpSchema for functions | feat"
justinchuby 46fa00f
Update on "Auto generate OpSchema for functions | feat"
justinchuby bbe8e7e
Update base for Update on "Auto generate OpSchema for functions | feat"
justinchuby 43345e2
Update on "Auto generate OpSchema for functions | feat"
justinchuby 26d5caa
Update base for Update on "Auto generate OpSchema for functions | feat"
justinchuby f835d9b
Update on "Auto generate OpSchema for functions | feat"
justinchuby b3a035d
Update base for Update on "Auto generate OpSchema for functions | feat"
justinchuby e953774
Update on "Auto generate OpSchema for functions | feat"
justinchuby 03cc7f4
Update base for Update on "Auto generate OpSchema for functions | feat"
justinchuby 7fda2d1
Update on "Auto generate OpSchema for functions | feat"
justinchuby 7321b22
Update base for Update on "Auto generate OpSchema for functions | feat"
justinchuby b760abc
Update on "Auto generate OpSchema for functions | feat"
justinchuby efc7708
Update base for Update on "Auto generate OpSchema for functions | feat"
justinchuby 606be97
Update on "Auto generate OpSchema for functions | feat"
justinchuby 67a8ee0
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby a3f9b50
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby 1d4a0b4
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby 08a27fa
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby 2d158ac
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby 28b4a48
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby 622b688
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby 19f9484
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby 31bb69c
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby b61543a
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby 2c6be92
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby 6cfa67c
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby a9a0845
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby 0502482
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby 79d3605
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby ad57790
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby 1439aaf
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby f2455dc
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby ea41c8f
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby a2fde87
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby 138c2ed
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby b334880
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby 90208e1
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby cef03af
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby 2d9627e
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby ed79fce
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby 8f5f7ba
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby 6376c93
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby 49d8d0e
Update base for Update on "Auto generate OpSchema for functions | fea…
justinchuby dd80bff
Update on "Auto generate OpSchema for functions | feat(op_schema)"
justinchuby b1c2c8f
Auto OpSchema for trace_only functions | feat(torchlib)
justinchuby 1ffa271
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby 70499c2
Update on "Auto OpSchema for trace_only functions | feat(torchlib)"
justinchuby ddfadb7
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby a216686
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby 732b8ed
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby 472938a
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby e4b64dd
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby 44b0e2b
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby e5cc885
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby fef104b
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby 9a7d093
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby 63ef23d
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby 86e94b2
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby fe6ee4b
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby ac947d6
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby b097c1a
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby 1d27554
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby 8abbf32
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby 2de051c
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby c45f86d
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby 4b0c0e8
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby aa1f1f1
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby eebda4c
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby c6bb7f9
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby 97215d1
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby 0d99f0a
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby e402626
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby 035391c
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby 187bf66
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby 4bc0463
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby 69a7c50
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby 99bd508
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby 15bb55b
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby 3888ad5
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby 16f3922
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby d4d6dcd
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby 3e9595a
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby bc10086
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby d3b2bb9
Update base for Update on "Auto OpSchema for trace_only functions | f…
justinchuby 01a423b
Update on "Auto OpSchema for trace_only functions | feat(op_schema)"
justinchuby File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""Utilities for working with Python ASTs.""" | ||
from __future__ import annotations | ||
|
||
import ast | ||
import inspect | ||
import textwrap | ||
import types | ||
|
||
|
||
def get_src_and_ast(f: types.FunctionType) -> tuple[str, ast.FunctionDef]: | ||
try: | ||
src = inspect.getsource(f) | ||
except OSError as e: | ||
raise RuntimeError( | ||
f"Decorator script does not work on dynamically " | ||
f"compiled function {f.__name__}." | ||
) from e | ||
src = textwrap.dedent(src) | ||
top_level_ast = ast.parse(src) | ||
assert isinstance(top_level_ast, ast.Module) | ||
assert len(top_level_ast.body) == 1 | ||
f_ast = top_level_ast.body[0] | ||
assert isinstance(f_ast, ast.FunctionDef) | ||
return src, f_ast |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.