matx.runtime.container module

Runtime container structures.

class matx.runtime.container.Array(seq=())[源代码]

基类: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=())[源代码]
class matx.runtime.container.ArrayIterator(obj)[源代码]

基类:object

__init__(obj)[源代码]
class matx.runtime.container.Map(seq=())[源代码]

基类: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=())[源代码]
get(key, default=None)[源代码]

Get an element with a default value.

参数:
  • key (object) – The attribute key.

  • default (object) – The default object.

返回:

value – The result value.

返回类型:

object

items()[源代码]

Get the items from the map

keys()[源代码]

Get the keys from the map

values()[源代码]

Get the values from the map

class matx.runtime.container.MapIterator(obj)[源代码]

基类:object

__init__(obj)[源代码]
class matx.runtime.container.Tuple(*fields)[源代码]

基类:Object

tuple object.

参数:

fields (List[Object]) – The source.

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

Helper function to implement a pythonic getitem function.

参数:
  • 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

返回:

result – The result of getitem

返回类型:

object

matx.runtime.container.slice_index_correction(index, length)[源代码]