Skip to content

Commit

Permalink
Update on "Allow for calling lift_fresh_copy manually"
Browse files Browse the repository at this point in the history
In this case, the input could be fake!  Just treat it normally in that case.

Fixes #113331

Signed-off-by: Edward Z. Yang <ezyangmeta.com>

cc avikchaudhuri gmagogsfm zhxchen17 tugsbayasgalan angelayi suo ydwu4

[ghstack-poisoned]
  • Loading branch information
ezyang committed Nov 17, 2023
1 parent dc251bd commit 049520a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions torch/_subclasses/fake_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1517,9 +1517,7 @@ def maybe_to_constant(t):
# this is generated from torch.tensor(), which does not use the
# dispatcher, to allow wrapper subclasses to wrap the new tensor
if func in self.lift_fns:
assert (
len(kwargs) == 0 and len(args) == 1
), f"{args} {kwargs}"
assert len(kwargs) == 0 and len(args) == 1, f"{args} {kwargs}"

if type(args[0]) is torch.Tensor:
return converter(self, args[0])
Expand Down

0 comments on commit 049520a

Please sign in to comment.