mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Revert "[BE] Make PyObjectSlot use a global PyInterpreter (#162659)"
This reverts commit d1993c27ae59842c887d549a3f8936fbcd769498. Reverted https://github.com/pytorch/pytorch/pull/162659 on behalf of https://github.com/wdvr due to reverted internally, please see D82771705 @PaliC ([comment](https://github.com/pytorch/pytorch/pull/162659#issuecomment-3317110247))
This commit is contained in:
@ -1187,7 +1187,8 @@ int64_t _Tensor_ndim(mpy::handle h) {
|
||||
mpy::handle handle_from_tensor(Arena& A, TensorRef t) {
|
||||
// fast case: tensor is live in python
|
||||
std::optional<PyObject*> mb_obj =
|
||||
t->unsafeGetTensorImpl()->pyobj_slot()->check_pyobj();
|
||||
t->unsafeGetTensorImpl()->pyobj_slot()->check_pyobj(
|
||||
/*ignore_hermetic_tls=*/false);
|
||||
if (mb_obj.has_value() &&
|
||||
!t->unsafeGetTensorImpl()->pyobj_slot()->owns_pyobj()) {
|
||||
return *mb_obj;
|
||||
|
Reference in New Issue
Block a user