PyTorch
|
Classes | |
struct | WarnAlways |
class | WarningHandlerGuard |
Functions | |
void | set_warning_handler (WarningHandler *handler) noexcept(true) |
Sets the global warning handler. More... | |
WarningHandler * | get_warning_handler () noexcept(true) |
Gets the global warning handler. More... | |
void | set_warnAlways (bool) noexcept(true) |
The TORCH_WARN_ONCE macro is difficult to test for. More... | |
bool | get_warnAlways (void) noexcept(true) |
|
noexcept |
|
noexcept |
Gets the global warning handler.
|
noexcept |
The TORCH_WARN_ONCE macro is difficult to test for.
Use setWarnAlways(true) to turn it into TORCH_WARN, which can be tested for more easily.
|
noexcept |
Sets the global warning handler.
This is not thread-safe, so it should generally be called once during initialization or while holding the GIL for programs that use python. User is responsible for keeping the WarningHandler alive until it is not needed.