Enable Leak Sanitizer (#154584)

It enables Leak Sanitizer and also provides a suppression file.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/154584
Approved by: https://github.com/ezyang
This commit is contained in:
cyy
2025-06-23 05:20:23 +00:00
committed by PyTorch MergeBot
parent 9fed2added
commit c79c7bbe61
6 changed files with 41 additions and 7 deletions

View File

@ -844,7 +844,7 @@ inline Variable make_variable_non_differentiable_view(
/*version_counter=*/impl::version_counter(base),
/*allow_tensor_metadata_change=*/allow_tensor_metadata_change);
data_impl_copy->set_autograd_meta(nullptr);
return Variable(data_impl_copy);
return Variable(std::move(data_impl_copy));
}
return Variable();
}
@ -903,7 +903,7 @@ inline Variable make_variable(
/*allow_tensor_metadata_change=*/allow_tensor_metadata_change);
data_impl_copy->set_autograd_meta(std::make_unique<AutogradMeta>(
data_impl_copy.get(), false, std::move(gradient_edge)));
return Variable(data_impl_copy);
return Variable(std::move(data_impl_copy));
}
return Variable();
}