tvm_ffi.device

Contents

tvm_ffi.device#

tvm_ffi.device(device_type, index=None)[source]#

Construct a TVM FFI device with given device type and index.

Parameters:
  • device_type (str or int) – The device type or name.

  • index (int, optional) – The device index.

Return type:

Device

Returns:

device (tvm_ffi.Device)

Examples

Device can be used to create reflection of device by string representation of the device type.

assert tvm_ffi.device("cuda:0") == tvm_ffi.device("cuda", 0)
assert tvm_ffi.device("cpu:0") == tvm_ffi.device("cpu", 0)