tvm_tirx.ir#
Shared IR types, expressions, statements, source locations, and modules.
Namespaces#
Location#
|
An identifier for a source location. |
|
Non-null source-location metadata attached to IR nodes. |
|
A source range with unchanged frontend coordinate units and endpoints. |
The canonical immutable location used when source information is unavailable. |
|
|
A callee's source location together with its caller's location. |
Type#
|
The top type, which admits any value. |
|
Function type. |
Type information that has not been supplied or computed. |
|
|
The concrete type whose only value is None. |
Type marker for opaque values that must be removed from finished IR. |
|
|
A pointer to an element type in a specified memory scope. |
|
A primitive scalar or vector data type, including the |
Semantic string type, independent of the function's calling convention. |
|
The type of a multi-dimensional |
|
|
The type of tuple values. |
|
The base class of all types. |
Expr#
|
Call a registered operator or another callable IR expression. |
|
Int constant. |
|
Float constant. |
|
Base class of literal constants. |
|
A literal payload with an explicit expression type. |
|
A data type literal whose expression type is AnyType. |
|
A string literal with |
|
Base class of typed IR expressions. |
|
A global variable in the IR. |
|
A typed staging expression representing a lambda computation. |
|
A traversable expression eliminated before executable IR. |
|
Base class for opaque values that must be removed from finished IR. |
|
Load an element or vector from an indexed expression source. |
|
A region of an arbitrary tensor expression. |
|
Tuple expression that groups several fields together. |
|
Get the index-th item from a tuple. |
|
A canonical local variable in the IR. |
|
Base class for callable IR function definitions. |
|
A registered primitive operator used as a |
|
The values of one operator attribute, keyed by operator. |
Stmt#
|
Base class of all the statements. |
|
Sequence of statements. |
|
Bind node. |
|
Evaluate an expression for its effects and discard its result. |
|
Exit the enclosing function with a return value. |
|
Execute one branch according to a boolean condition. |
|
Iterate from |
|
Repeat the body while the condition evaluates to true. |
|
Exit the innermost enclosing loop. |
|
Skip to the next iteration of the innermost enclosing loop. |
|
Check a condition and raise the specified error when it is false. |
|
An operation with enclosing-scope operands and one lexical body. |
|
Store a primitive value into a tensor destination. |
IRModule#
|
A collection of global functions and module-level metadata. |
Supporting classes#
|
Base class for structured operator and function attributes. |
|
A string-keyed attribute map for functions, modules, and calls. |
|
A registered global function referenced and serialized by name. |
Base class of all IR Nodes. |
|
|
A half-open interval stored as |
Base class for module-level information referenced by the IR. |
Operator functions (tvm_tirx.ir.prim)#
|
Get absolute value of the input element-wise. |
|
Take acos of input x. |
|
Take acos of input x. |
|
Create a new expression of the intersection of all conditions in the |
|
Create a new experssion of the union of all conditions in the arguments |
|
Take asin of input x. |
|
Take asinh of input x. |
|
Provide a true statement that can be used for simplifications |
|
Take atan of input x. |
|
Take arctan2(x1, x2). |
|
Take atanh of input x. |
|
Take bitwise and of two values |
|
Take bitwise not of input value |
|
Take bitwise or of two values |
|
Take bitwise xor of two values |
|
Take ceil of float input x. |
|
Generic ceildiv operator. |
|
Count leading zero bits of an integer x. |
|
Change the sign of x1 to that of x2, element-wise. |
|
Take cos of input x. |
|
Take cosh of input x. |
|
Compute a / b as in C/C++ semantics. |
|
Take gauss error function of the input x. |
|
Take exponential of input x. |
|
Calculate 2**x |
|
Calculate 10**x |
|
Take floor of float input x. |
|
Compute the floordiv of two expressions. |
|
Compute the floormod of two expressions. |
|
Take fused multiply-add of input x, y, z. |
|
Return the remainder of x divided by y with the same sign as x. |
|
Equivalent to sqrt(x1**2 + x2**2), element-wise. |
|
Conditional selection expression. |
|
Compute floor(a / b) where a and b are non-negative. |
|
Compute the remainder of indexdiv. |
|
Check if input value is finite. |
|
Check if input value is infinite. |
|
Check if input value is Nan. |
|
Returns x1 * (2 ** x2). |
|
Mark condition as likely. |
|
Take log of input x. |
|
Take log(x + 1) with respect to input x. |
|
Take log2 of input x. |
|
Take log10 of input x. |
|
Elementwise maximum of two primitive expressions. |
|
Elementwise minimum of two primitive expressions. |
|
Round elements of the array to the nearest integer. |
|
Return the next floating-point value after x1 towards x2. |
|
Count the number of set bits in input x. |
|
x power y |
|
x power y |
|
Round elements of the array to the nearest integer. |
|
Take reciprocal of square root of input x. |
|
Return the result of x left shifted by y bits. |
|
Return the result of x right shifted by y bits. |
|
Quick function to get sigmoid |
|
Take sin of input x. |
|
Take sinh of input x. |
|
Take square root of input x. |
|
Take tan of input x. |
|
Take hyperbolic tanh of input x. |
|
Get truncated value of the input. |
|
Compute the truncdiv of two expressions. |
|
Compute the truncmod of two expressions. |
|
Get the target's vscale value. |
IR helpers#
|
Construct a constant with an explicit or inferred primitive type. |
|
Display an object's fields as a text tree. |
|
Make a new IR node by its type key and fields |
|
Assert lhs and rhs are structurally equal to each other. |
|
Load tvm object from json_str. |
|
Save tvm object as json string. |
|
Return whether an expression has a primitive result type. |
|
Return whether a value is an ordinary variable with a primitive type. |
|
Derive a Call's result type from its current inputs without changing the Call. |
|
Register an operator property of an operator by name. |
|
Make sequence of statements |
Supporting functions#
|
Attach shared printer behavior without replacing native IR wrappers. |
|
Register a dialect-owned private printing convenience method. |
Tree Formatting Defaults#
- tvm_tirx.ir.DEFAULT_FOLD#
Tuple of field selectors to inline with their parent by default.
- tvm_tirx.ir.DEFAULT_EXPAND#
Tuple of field selectors to expand explicitly by default. This is empty because objects already expand unless a rule folds or hides them.
- tvm_tirx.ir.DEFAULT_HIDE#
Tuple of field selectors to omit by default.
- tvm_tirx.ir.DEFAULT_FOLD_FORMATTERS#
Standard folded representations, keyed by class. Callbacks take an object and return single-line text.