mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Replace throw std::runtime_error with torch_check in torch/csrc/distributed (#59683)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/59683 Replaces usages of throw std::runtime_error("foo") with the better torch_check(false, "foo") which allows C++ stacktraces to show up when TORCH_SHOW_CPP_STACKTRACES=1. This will hopefully provide much better debugging information when debugging crashes/flaky tests. ghstack-source-id: 131167210 Test Plan: CI Reviewed By: cbalioglu Differential Revision: D28981327 fbshipit-source-id: 677f569e28600263cab18759eb1b282e0391aa7b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9cdbddb3f7
commit
d433a55c94
@ -318,7 +318,7 @@ void PyRRef::backwardOwnerRRef(
|
||||
try {
|
||||
value = torch::jit::toIValue(obj, c10::TensorType::get());
|
||||
} catch (py::cast_error& e) {
|
||||
throw std::runtime_error("RRef should contain a tensor for .backward()");
|
||||
TORCH_CHECK(false, "RRef should contain a tensor for .backward()");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user