tvm_ffi.dtype#

class tvm_ffi.dtype(content)[source]#

Bases: str

TVM FFI dtype class.

Parameters:
  • dtype_str

  • content (Any)

Return type:

dtype

Note

This class subclasses str so it can be directly passed into other array api’s dtype arguments.

__init__()#

Methods

from_dlpack_data_type(dltype_data_type)

Create a dtype from a DLPack data type tuple.

with_lanes(lanes)

Create a new dtype with the given number of lanes.

Attributes

static from_dlpack_data_type(dltype_data_type)[source]#

Create a dtype from a DLPack data type tuple.

Parameters:

dltype_data_type (tuple[int, int, int]) – The DLPack data type tuple (type_code, bits, lanes).

Return type:

dtype

Returns:

The created dtype.

with_lanes(lanes)[source]#

Create a new dtype with the given number of lanes.

Parameters:

lanes (int) – The number of lanes.

Return type:

dtype

Returns:

dtype – The new dtype with the given number of lanes.

property itemsize: int#
property type_code: int#
property bits: int#
property lanes: int#