Skip to content

Commit

Permalink
[Forward-fix] check if source is None when using tensor out variants (p…
Browse files Browse the repository at this point in the history
…ytorch#108700)

Summary: As title

Test Plan: Sandcastle

Reviewed By: JacobSzwejbka

Differential Revision: D49029357

Pull Request resolved: pytorch#108700
Approved by: https://github.com/angelayi
  • Loading branch information
yanboliang authored and pytorchmergebot committed Sep 7, 2023
1 parent 34bb74c commit 027e3b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion torch/_dynamo/variables/torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,8 @@ def check_any_unspec(x):
elif isinstance(tensor_variable, TensorVariable):
assert isinstance(kwargs["out"], TensorVariable)
if (
kwargs["out"] in tx.output.graphargs
kwargs["out"].source
and kwargs["out"] in tx.output.graphargs
and kwargs["out"].size != tensor_variable.size
):
# It's hard to get out variants with resizing on graph inputs work
Expand Down

0 comments on commit 027e3b7

Please sign in to comment.