mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Remove unneeded std::make_optional (#141567)
Fixes #ISSUE_NUMBER Pull Request resolved: https://github.com/pytorch/pytorch/pull/141567 Approved by: https://github.com/albanD
This commit is contained in:
@ -344,7 +344,7 @@ bool isResurrectable(THPVariable* self) {
|
||||
// Check if this is hermetic. If it is, no resurrection.
|
||||
if (tensor.unsafeGetTensorImpl()->pyobj_slot()->check_pyobj(
|
||||
getPyInterpreter(), /*ignore_hermetic_tls=*/false) !=
|
||||
std::make_optional((PyObject*)self)) {
|
||||
(PyObject*)self) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -452,7 +452,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
|
||||
|
Reference in New Issue
Block a user