tvm_ffi.Device#

class tvm_ffi.Device#

Bases: object

Device represents a device in the ffi system.

Device is a thin wrapper around DLDevice in DLPack standard.

Parameters:
  • device_type (Union[str, int]) – The string representation of the device type

  • index (int) – The device id

Examples

You can use tvm_ffi.device function to create a Device.

assert tvm_ffi.device("cuda:0") == tvm_ffi.device("cuda", 0)
assert tvm_ffi.device("cpu:0") == tvm_ffi.device("cpu", 0)
__init__(*args, **kwargs)#

Methods

__init__(*args, **kwargs)

dlpack_device_type()

The device type int code used in the DLPack specification.

Attributes

index

The device index.

type

String representation of the device type.

dlpack_device_type()#

The device type int code used in the DLPack specification.

index#

The device index.

type#

String representation of the device type.