19 #ifndef TVM_RELAY_ERROR_H_
20 #define TVM_RELAY_ERROR_H_
26 #include <unordered_map>
56 std::stringstream stream_;
124 this->errors_.push_back(err);
140 std::string err_msg = err.str();
174 std::vector<CompileError> errors_;
176 std::unordered_map<ObjectRef, GlobalVar, ObjectPtrHash, ObjectPtrEqual> node_to_gv_;
Managed reference to GlobalVarNode.
Definition: expr.h:487
Managed reference class to IRModuleNode.
Definition: module.h:366
Definition: source_map.h:120
Custom Error class to be thrown during compilation.
Definition: error.h:63
CompileError()
default constructor.
Definition: error.h:84
CompileError(const ErrorBuilder &err)
construct error from error builder.
Definition: error.h:76
Span span
Location of the error.
Definition: error.h:66
CompileError(const CompileError &other)
copy constructor.
Definition: error.h:81
CompileError(const std::string &msg)
construct error from message.
Definition: error.h:71
An abstraction around how errors are stored and reported. Designed to be opaque to users,...
Definition: error.h:107
ErrorReporter()
default constructor.
Definition: error.h:110
void ReportAt(const GlobalVar &global, const ObjectRef &node, const CompileError &err)
Report an error against a program, using the full program error reporting strategy.
void RenderErrors(const IRModule &module, bool use_color=true)
Render all reported errors and exit the program.
void Report(const CompileError &err)
Report a CompileError.
Definition: error.h:119
bool AnyErrors()
Definition: error.h:171
void ReportAt(const GlobalVar &global, const ObjectRef &node, std::stringstream &err)
Report an error against a program, using the full program error reporting strategy.
Definition: error.h:139
Base class of all object reference.
Definition: object.h:519
bool defined() const
Definition: object.h:552
IRModule that holds the functions and type definitions.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
A wrapper around std::stringstream to build error. include/tvm/ir/type.h Can be consumed by CompileEr...
Definition: error.h:47
ErrorBuilder & operator<<(const T &val)
Definition: error.h:50
ObjectRef equal functor.
Definition: object.h:665
ObjectRef hash functor.
Definition: object.h:655