Skip to main content


Attribute primitives.

Attributes are key-value pairs that can be attached to a Node, Graph and other elements. Attributes are similar to inputs, except they are constant - their value doesn't change at runtime. The attribute name is always a string.

For exmple, mo.constant has a value attribute, representing the value of the constant it holds.

Attributes can hold various types of values, including primitive values, lists, tensors, etc.


Holds a set of attributes.


  • attrs (List[NamedAttribute]): The list of attributes held by this map.

Implemented traits:

AnyType, Copyable, Movable, Sized



__init__(inout self: Self, *attrs: NamedAttribute)

Constructs an AttrMap from internal Attribute representations.


  • attrs (*NamedAttribute): Variadic list of internal Attribute representations.


__len__(self: Self) -> Int

Returns the size of this map.