Remove unneeded std::make_optional (#143575)

Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/143575
Approved by: https://github.com/Skylion007
This commit is contained in:
cyy
2024-12-31 03:08:47 +00:00
committed by PyTorch MergeBot
parent 11bb94b7ea
commit 8df99b6a6e
2 changed files with 2 additions and 2 deletions

View File

@ -1852,7 +1852,7 @@ static int THPVariable_subclass_clear(THPVariable* self) {
if (!self->cdata.unsafeIsBorrowed() &&
tensor.unsafeGetTensorImpl()->pyobj_slot()->check_pyobj(
getPyInterpreter(), /*ignore_hermetic_tls=*/false) ==
std::make_optional((PyObject*)self)) {
(PyObject*)self) {
// TODO: empirically, on OS X this assert appears to be untrue
// In test_py_tensors_multi_async_call - ProcessGroupRpcTestWithSpawn
// distributed/rpc/test_process_group_agent.py

View File

@ -276,7 +276,7 @@ static std::vector<std::optional<c10::SymInt>> wrapIntegersInOptional(
intArray.begin(),
intArray.end(),
optVec.begin(),
[](const c10::SymInt& value) { return std::make_optional(value); });
[](const c10::SymInt& value) { return value; });
return optVec;
}