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 05ee8114f818a95745c812c3cd7aa8e784e61a9a. Reverted https://github.com/pytorch/pytorch/pull/162659 on behalf of https://github.com/jeanschmidt due to seems to have introduced errors in linting see https://github.com/pytorch/pytorch/actions/runs/17750689989/job/50444910643 ([comment](https://github.com/pytorch/pytorch/pull/162659#issuecomment-3298626136))
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