Skip to content

Commit 0412182

Browse files
authored
make sync logic more accurate for functionalization (#795)
1 parent 308f50b commit 0412182

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

functorch/csrc/init.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ void _propagate_functional_input_mutation(const Tensor& unwrapped, const Tensor&
5353
TORCH_INTERNAL_ASSERT(!at::functionalization::impl::isFunctionalTensor(unwrapped));
5454
auto wrapped_impl = at::functionalization::impl::unsafeGetFunctionalWrapper(wrapped);
5555
// Ensure that the input is up to date by committing any pending updates to the alias.
56-
bool any_updates = wrapped_impl->apply_updates();
57-
if (any_updates) {
58-
wrapped_impl->regenerate_from_base();
59-
}
56+
wrapped_impl->sync_();
6057
auto& wrapped_inner = wrapped_impl->value();
6158
// It would probably be more reasonable to check that the two tensors are aliased,
6259
// but we can't do that unless we give BatchedTensorImpl a notion of storage.

0 commit comments

Comments
 (0)