/aosp_15_r20/external/pytorch/c10/core/ |
H A D | SafePyObject.h | 22 struct C10_API SafePyObject { struct 24 SafePyObject(PyObject* data, c10::impl::PyInterpreter* pyinterpreter) in SafePyObject() function 26 SafePyObject(SafePyObject&& other) noexcept in SafePyObject() function 30 SafePyObject& operator=(SafePyObject&&) = delete; argument 32 SafePyObject(SafePyObject const& other) in SafePyObject() function 39 SafePyObject& operator=(SafePyObject const& other) { 54 ~SafePyObject() { in ~SafePyObject() argument 81 struct SafePyObjectT : private SafePyObject { 83 : SafePyObject(data, pyinterpreter) {} in SafePyObjectT() 84 SafePyObjectT(SafePyObjectT&& other) noexcept : SafePyObject(other) {} in SafePyObjectT() [all …]
|
H A D | SafePyObject.cpp | 5 PyObject* SafePyObject::ptr(const c10::impl::PyInterpreter* interpreter) const { in ptr()
|
/aosp_15_r20/external/pytorch/aten/src/ATen/ |
H A D | SavedTensorHooks.h | 18 std::stack<std::pair<c10::SafePyObject, c10::SafePyObject>> stack; 35 c10::SafePyObject pack_hook, 36 c10::SafePyObject unpack_hook); 37 static std::pair<c10::SafePyObject, c10::SafePyObject> pop_hooks(); 38 static std::optional<std::pair<c10::SafePyObject, c10::SafePyObject>>
|
H A D | SavedTensorHooks.cpp | 61 void SavedTensorDefaultHooks::push_hooks(SafePyObject pack_hook, SafePyObject unpack_hook) { in push_hooks() 67 std::pair<SafePyObject, SafePyObject> SavedTensorDefaultHooks::pop_hooks() { in pop_hooks() 69 std::pair<SafePyObject, SafePyObject> hooks = std::move(tls.stack.top()); in pop_hooks() 74 std::optional<std::pair<SafePyObject, SafePyObject>> SavedTensorDefaultHooks::get_hooks() { in get_hooks()
|
H A D | PythonTorchFunctionTLS.h | 14 static void push_onto_stack(std::shared_ptr<SafePyObject> mode); 15 static const std::shared_ptr<SafePyObject> pop_stack(); 16 static const std::shared_ptr<SafePyObject>& get_stack_at(int64_t idx); 29 std::vector<std::shared_ptr<c10::SafePyObject>> stack_;
|
H A D | ThreadLocalPythonObjects.h | 10 static void set(const std::string& key, std::shared_ptr<SafePyObject> value); 11 static const std::shared_ptr<SafePyObject>& get(const std::string& key); 18 std::unordered_map<std::string, std::shared_ptr<c10::SafePyObject>> obj_dict_;
|
H A D | PythonTorchFunctionTLS.cpp | 8 void PythonTorchFunctionTLS::push_onto_stack(std::shared_ptr<SafePyObject> mode) { in push_onto_stack() 12 const std::shared_ptr<SafePyObject> PythonTorchFunctionTLS::pop_stack() { in pop_stack() 19 const std::shared_ptr<SafePyObject>& PythonTorchFunctionTLS::get_stack_at(int64_t idx) { in get_stack_at()
|
H A D | ThreadLocalPythonObjects.cpp | 12 void ThreadLocalPythonObjects::set(const std::string& key, std::shared_ptr<SafePyObject> value) { in set() 16 const std::shared_ptr<SafePyObject>& ThreadLocalPythonObjects::get(const std::string& key) { in get()
|
/aosp_15_r20/external/pytorch/torch/csrc/autograd/ |
H A D | python_hook.cpp | 182 c10::SafePyObject(value, getPyInterpreter()), in compiled_args() 192 args.add_pre_hook(c10::SafePyObject(value, getPyInterpreter())); in compiled_args() 201 args.add_post_hook(c10::SafePyObject(value, getPyInterpreter())); in compiled_args() 236 c10::SafePyObject hook_obj(value, getPyInterpreter()); in compiled_args()
|
H A D | python_saved_variable_hooks.cpp | 65 c10::SafePyObject(pack_hook.release().ptr(), getPyInterpreter()), in push_hooks() 66 c10::SafePyObject(unpack_hook.release().ptr(), getPyInterpreter())); in push_hooks()
|
H A D | python_function.cpp | 344 args.add_backward(c10::SafePyObject(obj, getPyInterpreter())); in compiled_args() 351 c10::SafePyObject(bw_state, getPyInterpreter())); in compiled_args()
|
H A D | init.cpp | 1086 std::make_shared<c10::SafePyObject>(arg, getPyInterpreter())); in push_on_torch_function_stack()
|
/aosp_15_r20/external/pytorch/torch/csrc/dynamo/ |
H A D | compiled_autograd.h | 195 size_t emplace_hook(c10::SafePyObject&& fn) { in emplace_hook() 204 std::vector<c10::SafePyObject> hooks; 465 size_t add_backward(c10::SafePyObject&& obj) { in add_backward() 469 size_t add_backward_state(c10::SafePyObject&& obj) { in add_backward_state() 473 void add_tensor_pre_hook(c10::SafePyObject&& obj, int index) { in add_tensor_pre_hook() 479 void add_pre_hook(c10::SafePyObject&& obj) { in add_pre_hook() 485 void add_post_hook(c10::SafePyObject&& obj) { in add_post_hook() 491 void add_post_acc_grad_hook(c10::SafePyObject&& obj) { in add_post_acc_grad_hook()
|
H A D | python_compiled_autograd.cpp | 63 static PyObject* convert_hook_list(std::vector<c10::SafePyObject>& inputs) { in convert_hook_list()
|
H A D | guards.cpp | 2550 std::shared_ptr<c10::SafePyObject> mode = in check_nopybind()
|
/aosp_15_r20/external/pytorch/torch/csrc/utils/ |
H A D | python_torch_function_mode.h | 15 const std::shared_ptr<c10::SafePyObject>& get_cur_mode() { in get_cur_mode() 20 std::shared_ptr<c10::SafePyObject> cur_mode_;
|
H A D | python_dispatch.cpp | 40 ska::flat_hash_map<c10::DispatchKey, std::shared_ptr<c10::SafePyObject>>> 107 c10::SafePyObject func_; 440 std::make_shared<c10::SafePyObject>( in initDispatchBindings() 899 std::make_unique<c10::SafePyObject>(obj, getPyInterpreter()); in initDispatchBindings()
|
H A D | python_symnode.h | 36 pyobj_ = std::make_shared<c10::SafePyObject>( in PythonSymNodeImpl() 309 std::shared_ptr<c10::SafePyObject> pyobj_ = nullptr;
|
/aosp_15_r20/external/pytorch/aten/src/ATen/core/dispatch/ |
H A D | OperatorEntry.h | 214 void setReportErrorCallback_(std::unique_ptr<c10::SafePyObject> callback); 291 std::unique_ptr<c10::SafePyObject> report_error_callback_;
|
H A D | OperatorEntry.cpp | 586 void OperatorEntry::setReportErrorCallback_(std::unique_ptr<c10::SafePyObject> callback) { in registerKernel()
|
H A D | Dispatcher.h | 430 void setReportErrorCallback_(std::unique_ptr<c10::SafePyObject> callback) { in setReportErrorCallback_()
|
/aosp_15_r20/external/pytorch/torch/csrc/ |
H A D | Device.cpp | 184 std::make_shared<c10::SafePyObject>( in THPDevice_enter()
|
H A D | Module.cpp | 2090 std::make_shared<c10::SafePyObject>(arg.ptr(), getPyInterpreter())); in initModule()
|