Class AssertStmtObj#

Inheritance Relationships#

Base Type#

Class Documentation#

class AssertStmtObj : public tvm::StmtObj#

Assert condition, if an error occurs, return the error message.

The error is described by:

  • error_kind: the error kind (e.g. “RuntimeError”, “TypeError”, “ValueError”)

  • message_parts: an array of string fragments that are concatenated at runtime via TVMFFIErrorSetRaisedFromCStrParts. This enables string fragment reuse across multiple assertions to reduce binary size.

Public Functions

inline explicit AssertStmtObj(ffi::UnsafeInit tag)#
inline AssertStmtObj(PrimExpr condition, StringImm error_kind)#

Public Members

PrimExpr condition#

Condition to be checked.

StringImm error_kind#

The error kind, e.g. “RuntimeError”, “TypeError”, “ValueError”.

ffi::Array<StringImm> message_parts#

Error message fragments, concatenated at runtime when assertion fails.

Public Static Functions

static inline void RegisterReflection()#
static inline int32_t _GetOrAllocRuntimeTypeIndex()#
static inline int32_t RuntimeTypeIndex() noexcept#