Class Error¶
Defined in File Exception.h
Page Contents
Inheritance Relationships¶
Base Type¶
public std::exception
Derived Types¶
public c10::DistError
(Class DistError)public c10::EnforceFiniteError
(Class EnforceFiniteError)public c10::ErrorAlwaysShowCppStacktrace
(Class ErrorAlwaysShowCppStacktrace)public c10::IndexError
(Class IndexError)public c10::LinAlgError
(Class LinAlgError)public c10::NotImplementedError
(Class NotImplementedError)public c10::OnnxfiBackendSystemError
(Class OnnxfiBackendSystemError)public c10::OutOfMemoryError
(Class OutOfMemoryError)public c10::TypeError
(Class TypeError)public c10::ValueError
(Class ValueError)
Class Documentation¶
-
class Error : public std::exception¶
The primary ATen error class.
Provides a complete error message with source location information via
what()
, and a more concise message viawhat_without_backtrace()
. Don’t throw this directly; use TORCH_CHECK/TORCH_INTERNAL_ASSERT instead.NB: c10::Error is handled specially by the default torch to suppress the backtrace, see torch/csrc/Exceptions.h
Subclassed by c10::DistError, c10::EnforceFiniteError, c10::ErrorAlwaysShowCppStacktrace, c10::IndexError, c10::LinAlgError, c10::NotImplementedError, c10::OnnxfiBackendSystemError, c10::OutOfMemoryError, c10::TypeError, c10::ValueError
Public Functions
-
Error(SourceLocation source_location, std::string msg)¶
-
Error(const char *file, const uint32_t line, const char *condition, const std::string &msg, Backtrace backtrace, const void *caller = nullptr)¶
-
Error(std::string msg, Backtrace backtrace = nullptr, const void *caller = nullptr)¶
-
void add_context(std::string msg)¶
-
inline const std::string &msg() const¶
-
inline const std::vector<std::string> &context() const¶
-
const Backtrace &backtrace() const¶
-
const char *what() const noexcept override¶
Returns the complete error message, including the source location.
The returned pointer is invalidated if you call add_context() on this object.
-
inline const void *caller() const noexcept¶
-
inline virtual const char *what_without_backtrace() const noexcept¶
Returns only the error message string, without source location.
The returned pointer is invalidated if you call add_context() on this object.
-
Error(SourceLocation source_location, std::string msg)¶