| 367 | } |
| 368 | |
| 369 | static PyObject* PyTensorObject_register_hook(PyObject* self, PyObject* hook) { |
| 370 | HANDLE_ERRORS |
| 371 | const auto& _hook = py::cast<AutogradMeta::Hook>(py::reinterpret_borrow<py::object>(hook)); |
| 372 | ASSERT(RegisterTensorHook(PyTensor_Unpack(self), _hook)); |
| 373 | Py_RETURN_NONE; |
| 374 | END_HANDLE_ERRORS |
| 375 | } |
| 376 | |
| 377 | static PyObject* PyTensorObject__register_post_grad_accumulation_hook(PyObject* self, |
| 378 | PyObject* hook) { |
nothing calls this directly
no test coverage detected