tvm
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
tvm::relax::IfExprObj Class Reference

Condition expression. More...

#include <expr.h>

Inheritance diagram for tvm::relax::IfExprObj:
Collaboration diagram for tvm::relax::IfExprObj:

Public Member Functions

 IfExprObj (Expr cond, SeqExpr true_branch, SeqExpr false_branch)
 
 IfExprObj (ffi::UnsafeInit)
 
 TVM_FFI_DECLARE_OBJECT_INFO_FINAL ("relax.expr.IfExpr", IfExprObj, ExprObj)
 
- Public Member Functions inherited from tvm::ExprObj
 TVM_FFI_DECLARE_OBJECT_INFO ("ir.Expr", ExprObj, ffi::Object)
 

Static Public Member Functions

static void RegisterReflection ()
 
- Static Public Member Functions inherited from tvm::ExprObj
static void RegisterReflection ()
 

Public Attributes

Expr cond
 The condition.
 
SeqExpr true_branch
 The expression evaluated when condition is true.
 
SeqExpr false_branch
 The expression evaluated when condition is false.
 
- Public Attributes inherited from tvm::ExprObj
Location loc = UnknownLoc()
 Location that points to the original source code. Reserved debug information.
 
Type ty = MissingType()
 The deduced or annotated type of the expression.
 

Static Public Attributes

static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindDAGNode
 
- Static Public Attributes inherited from tvm::ExprObj
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode
 
static constexpr const uint32_t _type_child_slots = 64
 

Detailed Description

Condition expression.

Unlike traditional statement ifs, the if evalutes to the result of the branch taken.

x = if (true) { 1 } else { 0 }; // x is 1 y = if (false) { 1 } else { 0 }; // y is 0

Note
This is similar to C's ternary operator.

Constructor & Destructor Documentation

◆ IfExprObj() [1/2]

tvm::relax::IfExprObj::IfExprObj ( Expr  cond,
SeqExpr  true_branch,
SeqExpr  false_branch 
)
inlineexplicit

◆ IfExprObj() [2/2]

tvm::relax::IfExprObj::IfExprObj ( ffi::UnsafeInit  )
inlineexplicit

Member Function Documentation

◆ RegisterReflection()

static void tvm::relax::IfExprObj::RegisterReflection ( )
inlinestatic

◆ TVM_FFI_DECLARE_OBJECT_INFO_FINAL()

tvm::relax::IfExprObj::TVM_FFI_DECLARE_OBJECT_INFO_FINAL ( "relax.expr.IfExpr"  ,
IfExprObj  ,
ExprObj   
)

Member Data Documentation

◆ _type_s_eq_hash_kind

constexpr TVMFFISEqHashKind tvm::relax::IfExprObj::_type_s_eq_hash_kind = kTVMFFISEqHashKindDAGNode
staticconstexpr

◆ cond

Expr tvm::relax::IfExprObj::cond

The condition.

◆ false_branch

SeqExpr tvm::relax::IfExprObj::false_branch

The expression evaluated when condition is false.

◆ true_branch

SeqExpr tvm::relax::IfExprObj::true_branch

The expression evaluated when condition is true.


The documentation for this class was generated from the following file: