tvm_tirx.script.printer.doc

Contents

tvm_tirx.script.printer.doc#

Doc types for TVMScript Unified Printer

Classes#

Doc(source_paths)

Base class of all Docs

ExprDoc(source_paths)

Base class of all expression Docs

StmtDoc(source_paths, comment)

Base class of statement doc

StmtBlockDoc(stmts)

The container doc that holds a list of StmtDoc.

LiteralDoc(value[, path])

Doc that represents literal value

IdDoc(name)

Doc that represents identifier

AttrAccessDoc(value, name)

Doc that represents attribute access on an expression

IndexDoc(value, indices)

Doc that represents index access on an expression

CallDoc(callee, *args, **kwargs)

Doc that represents function call

OperationKind(*values)

This enum represents the kind of operation (operator) in OperationDoc

OperationDoc(kind, operands)

Doc that represents operation

LambdaDoc(args, body)

Doc that represents lambda function

TupleDoc(elements)

Doc that represents tuple literal

ListDoc(elements)

Doc that represents list literal

DictDoc(content)

Doc that represents dict literal

SliceDoc([start, stop, step])

Doc that represents slice in Index expression

AssignDoc(lhs, rhs[, annotation])

Doc that represents assign statement.

IfDoc(predicate, then_branch, else_branch)

If-then-else statement, with None for an absent else branch.

WhileDoc(predicate, body)

Doc that represents while statement.

ForDoc(lhs, rhs, body)

Doc that represents for statement.

ScopeDoc(lhs, rhs, body)

Doc that represents special scopes.

ExprStmtDoc(expr)

Doc that represents an expression as statement.

AssertDoc(test[, msg])

Doc that represents assert statement.

ReturnDoc(value)

Doc that represents return statement.

FunctionDoc(name, args, decorators, ...[, ...])

Doc that represents function definition.

ClassDoc(name, decorators, body)

Doc that represents class definition.

CommentDoc(comment)

Doc that represents comment.

DocStringDoc(docs)

Doc that represents docstring.