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_FFI_DECLARE_OBJECT_INFO_FINAL ("relax.expr.If", IfNode, ExprNode)
 
- Public Member Functions inherited from tvm::RelaxExprNode
 TVM_FFI_DECLARE_OBJECT_INFO ("ir.RelaxExpr", RelaxExprNode, BaseExprNode)
 
- Public Member Functions inherited from tvm::BaseExprNode
 TVM_FFI_DECLARE_OBJECT_INFO ("ir.BaseExpr", 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
ffi::Optional< ObjectRef > struct_info_ = ffi::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 Public Attributes inherited from tvm::RelaxExprNode
static constexpr const uint32_t _type_child_slots = 22
 
- Static Public Attributes inherited from tvm::BaseExprNode
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_FFI_DECLARE_OBJECT_INFO_FINAL()

tvm::relax::IfNode::TVM_FFI_DECLARE_OBJECT_INFO_FINAL ( "relax.expr.If"  ,
IfNode  ,
ExprNode   
)

Member Data Documentation

◆ _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: