matx.runtime.container module

Runtime container structures.

class matx.runtime.container.Array(seq=())[source]

Bases: Object

Array container of MATX.

You do not need to create Array explicitly. Normally python list and tuple will be converted automatically to Array during tvm function call. You may get Array in return values of TVM function call.

__init__(seq=())[source]
class matx.runtime.container.ArrayIterator(obj)[source]

Bases: object

__init__(obj)[source]
class matx.runtime.container.Map(seq=())[source]

Bases: Object

Map container of MATX IR.

You do not need to create Map explicitly. Normally python dict will be converted automaticall to Map during tvm function call. You can use convert to create a dict[Object-> Object] into a Map

__init__(seq=())[source]
get(key, default=None)[source]

Get an element with a default value.

Parameters:
  • key (object) – The attribute key.

  • default (object) – The default object.

Returns:

value – The result value.

Return type:

object

items()[source]

Get the items from the map

keys()[source]

Get the keys from the map

values()[source]

Get the values from the map

class matx.runtime.container.MapIterator(obj)[source]

Bases: object

__init__(obj)[source]
class matx.runtime.container.Tuple(*fields)[source]

Bases: Object

tuple object.

Parameters:

fields (List[Object]) – The source.

__init__(*fields)[source]
matx.runtime.container.getitem_helper(obj, elem_getter, length, idx)[source]

Helper function to implement a pythonic getitem function.

Parameters:
  • obj (object) – The original object

  • elem_getter (function) – A simple function that takes index and return a single element.

  • length (int) – The size of the array

  • idx (int or slice) – The argument passed to getitem

Returns:

result – The result of getitem

Return type:

object

matx.runtime.container.slice_index_correction(index, length)[source]