Class Error
Defined in File Exception.h
Page Contents
Inheritance Relationships
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::SyntaxError
(Class SyntaxError)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::SyntaxError, c10::TypeError, c10::ValueError
Public Functions
-
Error(const char *file, const uint32_t line, const char *condition, const std::string &msg, Backtrace backtrace, const void *caller = nullptr)
-
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 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(const char *file, const uint32_t line, const char *condition, const std::string &msg, Backtrace backtrace, const void *caller = nullptr)