tvm_tirx.ir.OpAttrMap

tvm_tirx.ir.OpAttrMap#

class tvm_tirx.ir.OpAttrMap(attr_name, column)#

Bases: object

The values of one operator attribute, keyed by operator.

Mirrors C++ OpAttrMap. Obtain one with Op.get_attr_map(). Lookups see later registrations, overrides and removals; register values with Op.set_attr(). Like the registry itself, the map is not synchronized with concurrent registration.

property attr_name#

The attribute name.

get(expr, default=None)#

Get the attribute of an operator with a fallback.

Parameters:
  • expr (Expr) – The operator. Any other expression yields default.

  • default (object) – The value to return when expr is not an Op or has no value.

Returns:

object – The registered value or default.