Home
last modified time | relevance | path

Searched refs:SafePyObject (Results 1 – 23 of 23) sorted by relevance

/aosp_15_r20/external/pytorch/c10/core/
H A DSafePyObject.h22 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 DSafePyObject.cpp5 PyObject* SafePyObject::ptr(const c10::impl::PyInterpreter* interpreter) const { in ptr()
/aosp_15_r20/external/pytorch/aten/src/ATen/
H A DSavedTensorHooks.h18 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 DSavedTensorHooks.cpp61 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 DPythonTorchFunctionTLS.h14 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 DThreadLocalPythonObjects.h10 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 DPythonTorchFunctionTLS.cpp8 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 DThreadLocalPythonObjects.cpp12 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 Dpython_hook.cpp182 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 Dpython_saved_variable_hooks.cpp65 c10::SafePyObject(pack_hook.release().ptr(), getPyInterpreter()), in push_hooks()
66 c10::SafePyObject(unpack_hook.release().ptr(), getPyInterpreter())); in push_hooks()
H A Dpython_function.cpp344 args.add_backward(c10::SafePyObject(obj, getPyInterpreter())); in compiled_args()
351 c10::SafePyObject(bw_state, getPyInterpreter())); in compiled_args()
H A Dinit.cpp1086 std::make_shared<c10::SafePyObject>(arg, getPyInterpreter())); in push_on_torch_function_stack()
/aosp_15_r20/external/pytorch/torch/csrc/dynamo/
H A Dcompiled_autograd.h195 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 Dpython_compiled_autograd.cpp63 static PyObject* convert_hook_list(std::vector<c10::SafePyObject>& inputs) { in convert_hook_list()
H A Dguards.cpp2550 std::shared_ptr<c10::SafePyObject> mode = in check_nopybind()
/aosp_15_r20/external/pytorch/torch/csrc/utils/
H A Dpython_torch_function_mode.h15 const std::shared_ptr<c10::SafePyObject>& get_cur_mode() { in get_cur_mode()
20 std::shared_ptr<c10::SafePyObject> cur_mode_;
H A Dpython_dispatch.cpp40 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 Dpython_symnode.h36 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 DOperatorEntry.h214 void setReportErrorCallback_(std::unique_ptr<c10::SafePyObject> callback);
291 std::unique_ptr<c10::SafePyObject> report_error_callback_;
H A DOperatorEntry.cpp586 void OperatorEntry::setReportErrorCallback_(std::unique_ptr<c10::SafePyObject> callback) { in registerKernel()
H A DDispatcher.h430 void setReportErrorCallback_(std::unique_ptr<c10::SafePyObject> callback) { in setReportErrorCallback_()
/aosp_15_r20/external/pytorch/torch/csrc/
H A DDevice.cpp184 std::make_shared<c10::SafePyObject>( in THPDevice_enter()
H A DModule.cpp2090 std::make_shared<c10::SafePyObject>(arg.ptr(), getPyInterpreter())); in initModule()