19 #ifndef TVM_RELAY_ERROR_H_ 20 #define TVM_RELAY_ERROR_H_ 26 #include <unordered_map> 56 std::stringstream stream_;
71 explicit CompileError(
const std::string& msg) : Error(msg), span(nullptr) {}
124 this->errors_.push_back(err);
140 std::string err_msg = err.str();
169 void RenderErrors(
const IRModule& module,
bool use_color =
true);
174 std::vector<CompileError> errors_;
176 std::unordered_map<ObjectRef, GlobalVar, ObjectPtrHash, ObjectPtrEqual> node_to_gv_;
181 #endif // TVM_RELAY_ERROR_H_ ErrorReporter()
default constructor.
Definition: error.h:110
ObjectRef equal functor.
Definition: object.h:634
IRModule that holds the functions and type definitions.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Custom Error class to be thrown during compilation.
Definition: error.h:63
CompileError(const std::string &msg)
construct error from message.
Definition: error.h:71
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
CompileError()
default constructor.
Definition: error.h:84
Definition: source_map.h:120
bool defined() const
Definition: object.h:544
ErrorBuilder & operator<<(const T &val)
Definition: error.h:50
CompileError(const CompileError &other)
copy constructor.
Definition: error.h:81
ObjectRef hash functor.
Definition: object.h:624
Managed reference to GlobalVarNode.
Definition: expr.h:477
Span span
Location of the error.
Definition: error.h:66
void Report(const CompileError &err)
Report a CompileError.
Definition: error.h:119
An abstraction around how errors are stored and reported. Designed to be opaque to users...
Definition: error.h:107
Base class of all object reference.
Definition: object.h:511
friend class CompileError
Definition: error.h:57
Managed reference class to IRModuleNode.
Definition: module.h:348
CompileError(const ErrorBuilder &err)
construct error from error builder.
Definition: error.h:76
A wrapper around std::stringstream to build error. include/tvm/ir/type.h Can be consumed by CompileEr...
Definition: error.h:47
bool AnyErrors()
Definition: error.h:171