19 #ifndef TVM_SCRIPT_PRINTER_DOC_H_
20 #define TVM_SCRIPT_PRINTER_DOC_H_
66 static constexpr
const char*
_type_key =
"script.printer.Doc";
126 static constexpr
const char*
_type_key =
"script.printer.ExprDoc";
171 static constexpr
const char*
_type_key =
"script.printer.StmtDoc";
201 v->Visit(
"stmts", &
stmts);
204 static constexpr
const char*
_type_key =
"script.printer.StmtBlockDoc";
242 v->Visit(
"value", &
value);
245 static constexpr
const char*
_type_key =
"script.printer.LiteralDoc";
321 v->Visit(
"name", &
name);
324 static constexpr
const char*
_type_key =
"script.printer.IdDoc";
358 v->Visit(
"value", &
value);
359 v->Visit(
"name", &
name);
362 static constexpr
const char*
_type_key =
"script.printer.AttrAccessDoc";
402 v->Visit(
"value", &
value);
406 static constexpr
const char*
_type_key =
"script.printer.IndexDoc";
449 v->Visit(
"callee", &
callee);
450 v->Visit(
"args", &
args);
455 static constexpr
const char*
_type_key =
"script.printer.CallDoc";
533 v->Visit(
"kind", &
kind);
537 static constexpr
const char*
_type_key =
"script.printer.OperationDoc";
574 v->Visit(
"args", &
args);
575 v->Visit(
"body", &
body);
578 static constexpr
const char*
_type_key =
"script.printer.LambdaDoc";
613 static constexpr
const char*
_type_key =
"script.printer.TupleDoc";
651 static constexpr
const char*
_type_key =
"script.printer.ListDoc";
693 v->Visit(
"keys", &
keys);
694 v->Visit(
"values", &
values);
697 static constexpr
const char*
_type_key =
"script.printer.DictDoc";
739 v->Visit(
"start", &
start);
740 v->Visit(
"stop", &
stop);
741 v->Visit(
"step", &
step);
744 static constexpr
const char*
_type_key =
"script.printer.SliceDoc";
785 v->Visit(
"lhs", &
lhs);
786 v->Visit(
"rhs", &
rhs);
790 static constexpr
const char*
_type_key =
"script.printer.AssignDoc";
832 static constexpr
const char*
_type_key =
"script.printer.IfDoc";
868 v->Visit(
"body", &
body);
871 static constexpr
const char*
_type_key =
"script.printer.WhileDoc";
911 v->Visit(
"lhs", &
lhs);
912 v->Visit(
"rhs", &
rhs);
913 v->Visit(
"body", &
body);
916 static constexpr
const char*
_type_key =
"script.printer.ForDoc";
958 v->Visit(
"lhs", &
lhs);
959 v->Visit(
"rhs", &
rhs);
960 v->Visit(
"body", &
body);
963 static constexpr
const char*
_type_key =
"script.printer.ScopeDoc";
1004 v->Visit(
"expr", &
expr);
1007 static constexpr
const char*
_type_key =
"script.printer.ExprStmtDoc";
1040 v->Visit(
"test", &
test);
1041 v->Visit(
"msg", &
msg);
1044 static constexpr
const char*
_type_key =
"script.printer.AssertDoc";
1076 v->Visit(
"value", &
value);
1079 static constexpr
const char*
_type_key =
"script.printer.ReturnDoc";
1124 v->Visit(
"name", &
name);
1125 v->Visit(
"args", &
args);
1128 v->Visit(
"body", &
body);
1131 static constexpr
const char*
_type_key =
"script.printer.FunctionDoc";
1171 v->Visit(
"name", &
name);
1173 v->Visit(
"body", &
body);
1176 static constexpr
const char*
_type_key =
"script.printer.ClassDoc";
1204 static constexpr
const char*
_type_key =
"script.printer.CommentDoc";
1226 static constexpr
const char*
_type_key =
"script.printer.DocStringDoc";
Visitor class to get the attributes of an AST/IR node. The content is going to be called for each fie...
Definition: reflection.h:52
Managed reference class to FloatImmNode.
Definition: expr.h:577
Managed reference class to IntImmNode.
Definition: expr.h:530
Definition: script_printer.h:149
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Runtime primitive data type.
Definition: data_type.h:43
static DataType Float(int bits, int lanes=1)
Construct an float type.
Definition: data_type.h:236
static DataType Bool(int lanes=1, bool is_scalable=false)
Construct a bool type.
Definition: data_type.h:262
static DataType Int(int bits, int lanes=1)
Construct an int type.
Definition: data_type.h:219
bool is_void() const
Definition: data_type.h:156
Base class of all object reference.
Definition: object.h:519
ObjectRef()=default
default constructor
base class of all object containers.
Definition: object.h:171
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
Reference to string objects.
Definition: string.h:98
Doc that represents assert statement.
Definition: doc.h:1031
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:1038
ExprDoc test
The expression to test.
Definition: doc.h:1034
TVM_DECLARE_FINAL_OBJECT_INFO(AssertDocNode, StmtDocNode)
static constexpr const char * _type_key
Definition: doc.h:1044
Optional< ExprDoc > msg
The optional error message when assertion failed.
Definition: doc.h:1036
Reference type of AssertDocNode.
Definition: doc.h:1053
AssertDoc(ExprDoc test, Optional< ExprDoc > msg=NullOpt)
Constructor of AssertDoc.
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(AssertDoc, StmtDoc, AssertDocNode)
Doc that represents assign statement.
Definition: doc.h:770
Optional< ExprDoc > annotation
The type annotation of this assignment.
Definition: doc.h:781
Optional< ExprDoc > rhs
The right hand side of the assignment.
Definition: doc.h:779
ExprDoc lhs
The left hand side of the assignment.
Definition: doc.h:773
static constexpr const char * _type_key
Definition: doc.h:790
TVM_DECLARE_FINAL_OBJECT_INFO(AssignDocNode, StmtDocNode)
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:783
Reference type of AssignDocNode.
Definition: doc.h:799
AssignDoc(ExprDoc lhs, Optional< ExprDoc > rhs, Optional< ExprDoc > annotation)
Constructor of AssignDoc.
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(AssignDoc, StmtDoc, AssignDocNode)
Doc that represents attribute access on another expression.
Definition: doc.h:349
static constexpr const char * _type_key
Definition: doc.h:362
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:356
String name
The attribute to be accessed.
Definition: doc.h:354
ExprDoc value
The target expression to be accessed.
Definition: doc.h:352
TVM_DECLARE_FINAL_OBJECT_INFO(AttrAccessDocNode, ExprDocNode)
Reference type of AttrAccessDocNode.
Definition: doc.h:371
AttrAccessDoc(ExprDoc value, String name)
Constructor of AttrAccessDoc.
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(AttrAccessDoc, ExprDoc, AttrAccessDocNode)
Doc that represents function call.
Definition: doc.h:431
Array< ExprDoc > kwargs_values
The values of keyword arguments.
Definition: doc.h:445
Array< ExprDoc > args
The positional arguments.
Definition: doc.h:436
TVM_DECLARE_FINAL_OBJECT_INFO(CallDocNode, ExprDocNode)
static constexpr const char * _type_key
Definition: doc.h:455
Array< String > kwargs_keys
The keys of keyword arguments.
Definition: doc.h:438
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:447
ExprDoc callee
The callee of this function call.
Definition: doc.h:434
Reference type of CallDocNode.
Definition: doc.h:464
CallDoc(ExprDoc callee, Array< ExprDoc > args, Array< String > kwargs_keys, Array< ExprDoc > kwargs_values)
Constructor of CallDoc.
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(CallDoc, ExprDoc, CallDocNode)
Doc that represents class definition.
Definition: doc.h:1160
static constexpr const char * _type_key
Definition: doc.h:1176
Array< ExprDoc > decorators
Decorators of class.
Definition: doc.h:1165
TVM_DECLARE_FINAL_OBJECT_INFO(ClassDocNode, StmtDocNode)
Array< StmtDoc > body
The body of class.
Definition: doc.h:1167
IdDoc name
The name of class.
Definition: doc.h:1163
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:1169
Reference type of ClassDocNode.
Definition: doc.h:1185
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(ClassDoc, StmtDoc, ClassDocNode)
ClassDoc(IdDoc name, Array< ExprDoc > decorators, Array< StmtDoc > body)
Constructor of ClassDoc.
Doc that represents dictionary literal.
Definition: doc.h:679
Array< ExprDoc > values
Values of dictionary.
Definition: doc.h:689
Array< ExprDoc > keys
keys of dictionary
Definition: doc.h:682
static constexpr const char * _type_key
Definition: doc.h:697
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:691
TVM_DECLARE_FINAL_OBJECT_INFO(DictDocNode, ExprDocNode)
Reference type of DictDocNode.
Definition: doc.h:706
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(DictDoc, ExprDoc, DictDocNode)
DictDoc(Array< ExprDoc > keys, Array< ExprDoc > values)
Constructor of DictDoc.
DictDoc()
Create an empty dictionary.
Definition: doc.h:711
The base class of all Doc.
Definition: doc.h:53
Array< ObjectPath > source_paths
The list of object paths of the source IR node.
Definition: doc.h:62
virtual ~DocNode()=default
TVM_DECLARE_BASE_OBJECT_INFO(DocNode, Object)
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:64
static constexpr const char * _type_key
Definition: doc.h:66
Doc that represents docstring.
Definition: doc.h:1224
static constexpr const char * _type_key
Definition: doc.h:1226
TVM_DECLARE_FINAL_OBJECT_INFO(DocStringDocNode, StmtDocNode)
Reference type of DocStringDocNode.
Definition: doc.h:1235
DocStringDoc(String docs)
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(DocStringDoc, StmtDoc, DocStringDocNode)
Reference type of DocNode.
Definition: doc.h:78
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(Doc, ObjectRef, DocNode)
The base class of expression doc.
Definition: doc.h:94
static constexpr const char * _type_key
Definition: doc.h:126
TVM_DECLARE_BASE_OBJECT_INFO(ExprDocNode, DocNode)
ExprDoc Attr(String attr) const
Create a doc representing attribute access on the current ExprDoc.
ExprDoc Call(Array< ExprDoc, void > args) const
Create a doc representing calling the current ExprDoc.
ExprDoc operator[](Array< Doc > indices) const
Create a doc representing index access on the current ExprDoc.
ExprDoc Call(Array< ExprDoc, void > args, Array< String > kwargs_keys, Array< ExprDoc, void > kwargs_values) const
Create a doc representing attribute access on the current ExprDoc.
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:124
Reference type of ExprDocNode.
Definition: doc.h:135
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(ExprDoc, Doc, ExprDocNode)
ExprDoc operator[](Array< Doc > indices) const
Create a doc representing index access on the current ExprDoc.
Doc that represents an expression as statement.
Definition: doc.h:997
static constexpr const char * _type_key
Definition: doc.h:1007
TVM_DECLARE_FINAL_OBJECT_INFO(ExprStmtDocNode, StmtDocNode)
ExprDoc expr
The expression represented by this doc.
Definition: doc.h:1000
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:1002
Reference type of ExprStmtDocNode.
Definition: doc.h:1016
ExprStmtDoc(ExprDoc expr)
Constructor of ExprStmtDoc.
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(ExprStmtDoc, StmtDoc, ExprStmtDocNode)
Doc that represents for statement.
Definition: doc.h:900
ExprDoc lhs
The left hand side of the assignment of iterating variable.
Definition: doc.h:903
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:909
static constexpr const char * _type_key
Definition: doc.h:916
ExprDoc rhs
The right hand side of the assignment of iterating variable.
Definition: doc.h:905
Array< StmtDoc > body
The body of the for statement.
Definition: doc.h:907
TVM_DECLARE_FINAL_OBJECT_INFO(ForDocNode, StmtDocNode)
Reference type of ForDocNode.
Definition: doc.h:925
ForDoc(ExprDoc lhs, ExprDoc rhs, Array< StmtDoc > body)
Constructor of ForDoc.
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(ForDoc, StmtDoc, ForDocNode)
Doc that represents function definition.
Definition: doc.h:1103
TVM_DECLARE_FINAL_OBJECT_INFO(FunctionDocNode, StmtDocNode)
Optional< ExprDoc > return_type
The return type of function.
Definition: doc.h:1118
Array< ExprDoc > decorators
Decorators of function.
Definition: doc.h:1116
Array< StmtDoc > body
The body of function.
Definition: doc.h:1120
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:1122
Array< AssignDoc > args
The arguments of function.
Definition: doc.h:1114
IdDoc name
The name of function.
Definition: doc.h:1106
static constexpr const char * _type_key
Definition: doc.h:1131
Reference type of FunctionDocNode.
Definition: doc.h:1140
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(FunctionDoc, StmtDoc, FunctionDocNode)
FunctionDoc(IdDoc name, Array< AssignDoc > args, Array< ExprDoc > decorators, Optional< ExprDoc > return_type, Array< StmtDoc > body)
Constructor of FunctionDoc.
Doc that represents identifier.
Definition: doc.h:314
TVM_DECLARE_FINAL_OBJECT_INFO(IdDocNode, ExprDocNode)
String name
The name of the identifier.
Definition: doc.h:317
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:319
static constexpr const char * _type_key
Definition: doc.h:324
Reference type of IdDocNode.
Definition: doc.h:333
IdDoc(std::nullptr_t)
Definition: doc.h:340
IdDoc(String name)
Constructor of IdDoc.
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(IdDoc, ExprDoc, IdDocNode)
Doc that represent if-then-else statement.
Definition: doc.h:816
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:825
TVM_DECLARE_FINAL_OBJECT_INFO(IfDocNode, StmtDocNode)
Array< StmtDoc > else_branch
The else branch of the if-then-else statement.
Definition: doc.h:823
static constexpr const char * _type_key
Definition: doc.h:832
Array< StmtDoc > then_branch
The then branch of the if-then-else statement.
Definition: doc.h:821
ExprDoc predicate
The predicate of the if-then-else statement.
Definition: doc.h:819
Reference type of IfDocNode.
Definition: doc.h:841
IfDoc(ExprDoc predicate, Array< StmtDoc > then_branch, Array< StmtDoc > else_branch)
Constructor of IfDoc.
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(IfDoc, StmtDoc, IfDocNode)
Doc that represents index access on another expression.
Definition: doc.h:387
static constexpr const char * _type_key
Definition: doc.h:406
TVM_DECLARE_FINAL_OBJECT_INFO(IndexDocNode, ExprDocNode)
ExprDoc value
The container value to be accessed.
Definition: doc.h:390
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:400
Array< Doc > indices
The indices to access.
Definition: doc.h:398
Reference type of IndexDocNode.
Definition: doc.h:415
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(IndexDoc, ExprDoc, IndexDocNode)
IndexDoc(ExprDoc value, Array< Doc > indices)
Constructor of IndexDoc.
Doc that represents anonymous function.
Definition: doc.h:565
Array< IdDoc > args
The arguments of this anonymous function.
Definition: doc.h:568
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:572
ExprDoc body
The body of this anonymous function.
Definition: doc.h:570
static constexpr const char * _type_key
Definition: doc.h:578
TVM_DECLARE_FINAL_OBJECT_INFO(LambdaDocNode, ExprDocNode)
Reference type of LambdaDocNode.
Definition: doc.h:587
LambdaDoc(Array< IdDoc > args, ExprDoc body)
Constructor of LambdaDoc.
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(LambdaDoc, ExprDoc, LambdaDocNode)
Doc that represents list literal.
Definition: doc.h:641
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:646
Array< ExprDoc > elements
Elements of list.
Definition: doc.h:644
TVM_DECLARE_FINAL_OBJECT_INFO(ListDocNode, ExprDocNode)
static constexpr const char * _type_key
Definition: doc.h:651
Reference type of ListDocNode.
Definition: doc.h:660
ListDoc()
Create an empty ListDoc.
Definition: doc.h:665
ListDoc(Array< ExprDoc > elements)
Constructor of ListDoc.
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(ListDoc, ExprDoc, ListDocNode)
Doc that represents literal value.
Definition: doc.h:227
static constexpr const char * _type_key
Definition: doc.h:245
ObjectRef value
the internal representation of the literal value.
Definition: doc.h:238
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:240
TVM_DECLARE_FINAL_OBJECT_INFO(LiteralDocNode, ExprDocNode)
Reference type of LiteralDocNode.
Definition: doc.h:254
static LiteralDoc Float(double v, const Optional< ObjectPath > &p)
Create a LiteralDoc to represent float.
Definition: doc.h:287
static LiteralDoc Int(int64_t v, const Optional< ObjectPath > &p)
Create a LiteralDoc to represent integer.
Definition: doc.h:271
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(LiteralDoc, ExprDoc, LiteralDocNode)
static LiteralDoc Str(const String &v, const Optional< ObjectPath > &p)
Create a LiteralDoc to represent string.
Definition: doc.h:295
LiteralDoc(ObjectRef value, const Optional< ObjectPath > &object_path)
static LiteralDoc Boolean(bool v, const Optional< ObjectPath > &p)
Create a LiteralDoc to represent boolean.
Definition: doc.h:279
static LiteralDoc DataType(const runtime::DataType &v, const Optional< ObjectPath > &p)
Create a LiteralDoc to represent string.
Definition: doc.h:301
static LiteralDoc None(const Optional< ObjectPath > &p)
Create a LiteralDoc to represent None/null/empty value.
Definition: doc.h:263
Doc that represents operation.
Definition: doc.h:486
TVM_DECLARE_FINAL_OBJECT_INFO(OperationDocNode, ExprDocNode)
Array< ExprDoc > operands
Operands of this expression.
Definition: doc.h:529
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:531
static constexpr const char * _type_key
Definition: doc.h:537
Kind kind
The kind of operation (operator)
Definition: doc.h:527
Kind
Definition: doc.h:488
Reference type of OperationDocNode.
Definition: doc.h:546
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(OperationDoc, ExprDoc, OperationDocNode)
OperationDoc(OperationDocNode::Kind kind, Array< ExprDoc > operands)
Constructor of OperationDoc.
Doc that represents return statement.
Definition: doc.h:1069
ExprDoc value
The value to return.
Definition: doc.h:1072
TVM_DECLARE_FINAL_OBJECT_INFO(ReturnDocNode, StmtDocNode)
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:1074
static constexpr const char * _type_key
Definition: doc.h:1079
Reference type of ReturnDocNode.
Definition: doc.h:1088
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(ReturnDoc, StmtDoc, ReturnDocNode)
ReturnDoc(ExprDoc value)
Constructor of ReturnDoc.
Doc that represents special scopes.
Definition: doc.h:947
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:956
TVM_DECLARE_FINAL_OBJECT_INFO(ScopeDocNode, StmtDocNode)
Optional< ExprDoc > lhs
The name of the scoped variable.
Definition: doc.h:950
static constexpr const char * _type_key
Definition: doc.h:963
ExprDoc rhs
The value of the scoped variable.
Definition: doc.h:952
Array< StmtDoc > body
The body of the scope doc.
Definition: doc.h:954
Reference type of ScopeDocNode.
Definition: doc.h:972
ScopeDoc(ExprDoc rhs, Array< StmtDoc > body)
Constructor of ScopeDoc.
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(ScopeDoc, StmtDoc, ScopeDocNode)
ScopeDoc(Optional< ExprDoc > lhs, ExprDoc rhs, Array< StmtDoc > body)
Constructor of ScopeDoc.
Doc that represents slice in Index expression.
Definition: doc.h:728
Optional< ExprDoc > start
The start of slice.
Definition: doc.h:731
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:737
static constexpr const char * _type_key
Definition: doc.h:744
Optional< ExprDoc > step
The step of slice.
Definition: doc.h:735
Optional< ExprDoc > stop
The exclusive end of slice.
Definition: doc.h:733
TVM_DECLARE_FINAL_OBJECT_INFO(SliceDocNode, DocNode)
Reference type of SliceDocNode.
Definition: doc.h:753
SliceDoc(Optional< ExprDoc > start, Optional< ExprDoc > stop, Optional< ExprDoc > step)
Constructor of SliceDoc.
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(SliceDoc, Doc, SliceDocNode)
The container doc that holds a list of StmtDoc.
Definition: doc.h:194
TVM_DECLARE_FINAL_OBJECT_INFO(StmtBlockDocNode, DocNode)
Array< StmtDoc > stmts
The list of statements.
Definition: doc.h:197
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:199
static constexpr const char * _type_key
Definition: doc.h:204
Reference type of StmtBlockDocNode.
Definition: doc.h:212
StmtBlockDoc(Array< StmtDoc > stmts)
Constructor of StmtBlockDoc.
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(StmtBlockDoc, Doc, StmtBlockDocNode)
The base class of statement doc.
Definition: doc.h:154
TVM_DECLARE_BASE_OBJECT_INFO(StmtDocNode, DocNode)
static constexpr const char * _type_key
Definition: doc.h:171
Optional< String > comment
The comment of this doc.
Definition: doc.h:164
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:166
Reference type of StmtDocNode.
Definition: doc.h:180
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(StmtDoc, Doc, StmtDocNode)
Doc that represents tuple literal.
Definition: doc.h:603
Array< ExprDoc > elements
Elements of tuple.
Definition: doc.h:606
static constexpr const char * _type_key
Definition: doc.h:613
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:608
TVM_DECLARE_FINAL_OBJECT_INFO(TupleDocNode, ExprDocNode)
Reference type of TupleDocNode.
Definition: doc.h:622
TupleDoc(Array< ExprDoc > elements)
Constructor of TupleDoc.
TupleDoc()
Create an empty TupleDoc.
Definition: doc.h:627
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(TupleDoc, ExprDoc, TupleDocNode)
Doc that represents while statement.
Definition: doc.h:858
void VisitAttrs(AttrVisitor *v)
Definition: doc.h:865
static constexpr const char * _type_key
Definition: doc.h:871
Array< StmtDoc > body
The body of the while statement.
Definition: doc.h:863
TVM_DECLARE_FINAL_OBJECT_INFO(WhileDocNode, StmtDocNode)
ExprDoc predicate
The predicate of the while statement.
Definition: doc.h:861
Reference type of WhileDocNode.
Definition: doc.h:880
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(WhileDoc, StmtDoc, WhileDocNode)
WhileDoc(ExprDoc predicate, Array< StmtDoc > body)
Constructor of WhileDoc.
ObjectPtr< ArrayNode > make_object()
Definition: array.h:908
std::string DLDataType2String(DLDataType t)
convert a TVM type to string.
Definition: data_type.h:422
String DocToPythonScript(Doc doc, const PrinterConfig &cfg)
Convert Doc into Python script.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
constexpr runtime::NullOptType NullOpt
Definition: optional.h:169
Definitions and helper macros for IR/AST nodes.