Function c10::Warning::set_warning_handler

Function Documentation

void c10::Warning::set_warning_handler(WarningHandler *handler) noexcept(true)

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.


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources