-
Notifications
You must be signed in to change notification settings - Fork 24.8k
[dynamic shapes] guard_or_false for _reshape_view_helper, utils._infer_size for wildcard dims #150127
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
[dynamic shapes] guard_or_false for _reshape_view_helper, utils._infer_size for wildcard dims #150127
Changes from 1 commit
7510a77
4630374
e076ca4
ed8ed35
fafaa47
fe734e8
11a25a7
8a48fad
ac40d4c
207d3fb
1790f35
1dd4c2b
9d35a27
cab5f4a
f5b10c4
2eb56d0
9604307
00031a1
983174e
7c8d113
20749a3
5885633
18496a9
af74f34
69c1abe
2ac1303
ffe4273
fa11fa1
85fd59e
6d322e6
07c6ac9
5fa8ce9
c85b5ce
b0db707
2bca726
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -932,10 +932,9 @@ def infer_size(shape: ShapeType, numel: int) -> tuple[int, ...]: | |
if guard_or_false(d == -1): | ||
laithsakka marked this conversation as resolved.
Show resolved
Hide resolved
laithsakka marked this conversation as resolved.
Show resolved
Hide resolved
|
||
torch._check(dim is None, lambda: "only one dimension can be inferred") | ||
dim = i | ||
elif d >= 0: | ||
newsize *= d | ||
else: | ||
torch._check(False, lambda: f"invalid shape dimension {d}") | ||
torch._check(d >= 0, lambda: f"invalid shape dimension {d}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add in the error message before landing that if if d is unbaked, then we assumed its not -1. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, the lambda can only access the symbolic d anyways, we can't access the actual runtime property. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so you do materialize the lambda during compile with the deferred runtime assertion is created |
||
newsize *= d | ||
if dim is None: | ||
torch._check( | ||
numel == newsize, | ||
|
Uh oh!
There was an error while loading. Please reload this page.