Class Error#
Defined inFile Exception.h
Inheritance Relationships#
Base Type#
publicstd::exception
Derived Types#
publicc10::AcceleratorError(Class AcceleratorError)publicc10::BufferError(Class BufferError)publicc10::DistError(Class DistError)publicc10::EnforceFiniteError(Class EnforceFiniteError)publicc10::ErrorAlwaysShowCppStacktrace(Class ErrorAlwaysShowCppStacktrace)publicc10::IndexError(Class IndexError)publicc10::LinAlgError(Class LinAlgError)publicc10::NotImplementedError(Class NotImplementedError)publicc10::OnnxfiBackendSystemError(Class OnnxfiBackendSystemError)publicc10::OutOfMemoryError(Class OutOfMemoryError)publicc10::SyntaxError(Class SyntaxError)publicc10::TypeError(Class TypeError)publicc10::ValueError(Class ValueError)
Class Documentation#
- classError:publicstd::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 byc10::AcceleratorError,c10::BufferError,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(SourceLocationsource_location,std::stringmsg)#
- Error(constchar*file,constuint32_tline,constchar*condition,conststd::string&msg,Backtracebacktrace,constvoid*caller=nullptr)#
- Error(std::stringmsg,Backtracebacktrace=nullptr,constvoid*caller=nullptr)#
- voidadd_context(std::stringmsg)#
- inlineconststd::string&msg()const#
- inlineconststd::vector<std::string>&context()const#
- constBacktrace&backtrace()const#
- constchar*what()constnoexceptoverride#
Returns the complete error message, including the source location.
The returned pointer is invalidated if you calladd_context() on this object.
- inlineconstvoid*caller()constnoexcept#
- inlinevirtualconstchar*what_without_backtrace()constnoexcept#
Returns only the error message string, without source location.
The returned pointer is invalidated if you calladd_context() on this object.
- Error(SourceLocationsource_location,std::stringmsg)#