Home
last modified time | relevance | path

Searched refs:unpack_hook (Results 1 – 14 of 14) sorted by relevance

/external/pytorch/torch/csrc/autograd/
Dpython_saved_variable_hooks.cpp13 py::function& unpack_hook) in PySavedVariableHooks() argument
16 unpack_hook_(unpack_hook.release().ptr()) {} in PySavedVariableHooks()
62 py::function& unpack_hook) { in push_hooks() argument
66 c10::SafePyObject(unpack_hook.release().ptr(), getPyInterpreter())); in push_hooks()
70 auto [pack_hook, unpack_hook] = at::SavedTensorDefaultHooks::pop_hooks(); in pop_hooks()
73 unpack_hook.ptr(getPyInterpreter()) != nullptr); in pop_hooks()
81 auto [pack_hook, unpack_hook] = *out; in get_hooks()
86 py::reinterpret_steal<py::function>(unpack_hook.release()); in get_hooks()
Dpython_saved_variable_hooks.h16 PySavedVariableHooks(py::function& pack_hook, py::function& unpack_hook);
28 static void push_hooks(py::function& pack_hook, py::function& unpack_hook);
Dinit.cpp427 [](py::function& pack_hook, py::function& unpack_hook) { in THPAutograd_initExtension() argument
429 pack_hook, unpack_hook); in THPAutograd_initExtension()
522 py::function& unpack_hook) { in THPAutograd_initExtension() argument
527 pack_hook, unpack_hook)); in THPAutograd_initExtension()
/external/pytorch/torch/autograd/
Dgraph.py273 unpack_hook: Callable[[Any], torch.Tensor],
276 self.unpack_hook = unpack_hook
280 self.pack_hook, self.unpack_hook
596 def unpack_hook(tup): function
610 super().__init__(pack_hook, unpack_hook)
/external/pytorch/aten/src/ATen/
DSavedTensorHooks.cpp61 void SavedTensorDefaultHooks::push_hooks(SafePyObject pack_hook, SafePyObject unpack_hook) { in push_hooks() argument
64 tls.stack.emplace(std::move(pack_hook), std::move(unpack_hook)); in push_hooks()
DSavedTensorHooks.h36 c10::SafePyObject unpack_hook);
/external/pytorch/torch/utils/
Dcheckpoint.py1091 def unpack_hook(x): function
1096 super().__init__(pack_hook, unpack_hook)
1111 def unpack_hook(holder): function
1147 return unpack_hook(holder)
1152 super().__init__(pack_hook, unpack_hook)
/external/pytorch/docs/source/notes/
Dautograd.rst703 <saved-tensors-doc>` by defining a pair of ``pack_hook`` / ``unpack_hook``
706 string containing a filename). The ``unpack_hook`` function takes as its single
708 the backward pass. The tensor returned by ``unpack_hook`` only needs to have
729 def unpack_hook(temp_file):
732 Notice that the ``unpack_hook`` should not delete the temporary file because it
740 We guarantee that ``pack_hook`` will only be called once but ``unpack_hook`` can
764 y.grad_fn._raw_saved_self.register_hooks(pack_hook, unpack_hook)
767 The ``unpack_hook`` method is called each time the saved tensor needs to be
801 def unpack_hook(tensor_or_sctf):
808 with torch.autograd.graph.saved_tensors_hooks(pack_hook, unpack_hook):
[all …]
/external/pytorch/torch/_C/
D_autograd.pyi115 unpack_hook: Callable[[Any], torch.Tensor],
D__init__.pyi.in1330 def _register_default_hooks(pack_hook: Callable, unpack_hook: Callable) -> None: ...
/external/pytorch/test/distributed/fsdp/
Dtest_checkpoint_wrapper.py354 saved_tensor_hook_obj.unpack_hook = testing_cpu_offload_unpack_hook
/external/pytorch/test/inductor/
Dtest_compiled_autograd.py2648 def unpack_hook(x): function
2661 pack_hook, unpack_hook
/external/pytorch/test/
Dtest_autograd.py9523 def unpack_hook(x): function
9526 super().__init__(lambda x: x, unpack_hook)
9573 def unpack_hook(x): function
9580 with torch.autograd.graph.saved_tensors_hooks(pack_hook, unpack_hook):
9609 def unpack_hook(x): function
9612 with torch.autograd.graph.saved_tensors_hooks(pack_hook, unpack_hook):
/external/pytorch/test/dynamo/
Dtest_repros.py1097 def unpack_hook(x): function
1104 with torch.autograd.graph.saved_tensors_hooks(pack_hook, unpack_hook):