mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
refactor: replace runtime_error with TORCH_CHECK for better error handling (#163628)
Fixes some parts of issue #148114 @pytorchbot label "topic: not user facing" @FFFrog PTAL Pull Request resolved: https://github.com/pytorch/pytorch/pull/163628 Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
69b05913fb
commit
f06e669f6c
@ -500,9 +500,9 @@ static void child_atfork() {
|
||||
|
||||
bool THPEngine_initModule(PyObject* module) {
|
||||
#ifndef _WIN32
|
||||
if (pthread_atfork(nullptr, nullptr, child_atfork) != 0) {
|
||||
TORCH_CHECK(false, "unable to set pthread_atfork handler");
|
||||
}
|
||||
TORCH_CHECK(
|
||||
pthread_atfork(nullptr, nullptr, child_atfork) == 0,
|
||||
"unable to set pthread_atfork handler");
|
||||
#endif
|
||||
if (PyType_Ready(&THPEngineType) < 0)
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user