The primary ATen error class. More...
#include <Exception.h>
Public Member Functions | |
Error (const std::string &msg, const std::string &backtrace, const void *caller=nullptr) | |
Error (SourceLocation source_location, const std::string &msg) | |
Error (const char *file, const uint32_t line, const char *condition, const std::string &msg, const std::string &backtrace, const void *caller=nullptr) | |
void | AppendMessage (const std::string &msg) |
std::string | msg () const |
std::string | msg_without_backtrace () const |
const std::vector< std::string > & | msg_stack () const |
const char * | what () const noexceptoverride |
Returns the complete error message, including the source location. | |
const void * | caller () const noexcept |
const char * | what_without_backtrace () const noexcept |
Returns only the error message string, without source location. | |
The primary ATen error class.
Provides a complete error message with source location information via what()
, and a more concise message via what_without_backtrace()
. Should primarily be used with the AT_ERROR
macro.
NB: c10::Error is handled specially by the default torch to suppress the backtrace, see torch/csrc/Exceptions.h
Definition at line 27 of file Exception.h.