tvm_tirx::ir

Module expr

Source
Expand description

Expressions: variables, constants, calls, tuples and tensor accesses.

The objects python/tvm_tirx/ir/expr.py defines. Expr is the base of every expression and carries its type and location. The primitive arithmetic and vector expressions are in prim. The constructors are new, or from_dtype and the like where new allocates the fields as given; they are written in Rust after the C++ constructors, with their checks, defaults and errors. The constants of the common types are IntImm::int32, IntImm::int64, IntImm::bool, FloatImm::float32 and FloatImm::float64, and an i32, i64, bool, f32 or f64 converts into an Expr as C++ converts it implicitly.

Structs§

Enums§

Traits§

  • What converts to an expression, possibly failing: anything that converts into an Expr (a node, a Var, a Rust i32, f32 and the like), and an ExprResult, an expression under construction, which gives the first error any of its steps raised. The constructors and functions that can fail take their expression operands as impl IntoExpr, so an ExprResult passes straight in and ? on their result covers it.