tvm
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
tvm::relax::IfNode Class Reference

Condition expression. More...

#include <expr.h>

Inheritance diagram for tvm::relax::IfNode:
Collaboration diagram for tvm::relax::IfNode:

Public Member Functions

 TVM_DECLARE_FINAL_OBJECT_INFO (IfNode, ExprNode)
 
- Public Member Functions inherited from tvm::RelaxExprNode
 TVM_DECLARE_BASE_OBJECT_INFO (RelaxExprNode, BaseExprNode)
 
- Public Member Functions inherited from tvm::BaseExprNode
 TVM_DECLARE_BASE_OBJECT_INFO (BaseExprNode, Object)
 

Static Public Member Functions

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

Public Attributes

Expr cond
 The condition. More...
 
SeqExpr true_branch
 The expression evaluated when condition is true. More...
 
SeqExpr false_branch
 The expression evaluated when condition is false. More...
 
- Public Attributes inherited from tvm::RelaxExprNode
Optional< ObjectRef > struct_info_ = Optional<ObjectRef>()
 Stores the result of structure information of the expression that encapsulate both static shape and runtime information such as shape. More...
 
- Public Attributes inherited from tvm::BaseExprNode
Span span
 Span that points to the original source code. Reserved debug information. More...
 

Static Public Attributes

static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindDAGNode
 
static constexpr const char * _type_key = "relax.expr.If"
 
- Static Public Attributes inherited from tvm::RelaxExprNode
static constexpr const char * _type_key = "ir.RelaxExpr"
 
static constexpr const uint32_t _type_child_slots = 22
 
- Static Public Attributes inherited from tvm::BaseExprNode
static constexpr const char * _type_key = "ir.BaseExpr"
 
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.

Member Function Documentation

◆ RegisterReflection()

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

◆ TVM_DECLARE_FINAL_OBJECT_INFO()

tvm::relax::IfNode::TVM_DECLARE_FINAL_OBJECT_INFO ( IfNode  ,
ExprNode   
)

Member Data Documentation

◆ _type_key

constexpr const char* tvm::relax::IfNode::_type_key = "relax.expr.If"
staticconstexpr

◆ _type_s_eq_hash_kind

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

◆ cond

Expr tvm::relax::IfNode::cond

The condition.

◆ false_branch

SeqExpr tvm::relax::IfNode::false_branch

The expression evaluated when condition is false.

◆ true_branch

SeqExpr tvm::relax::IfNode::true_branch

The expression evaluated when condition is true.


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