Python module
driver
CPU()
Creates a CPU device with the provided numa id.
CUDA()
Creates a CUDA device with the provided id.
DLPackArray
class max.driver.DLPackArray(*args, **kwargs)
Device
class max.driver.Device(_device: Device)
Device object. Limited to CUDA and CPU devices for now.
cpu()
Creates a CPU device with the provided numa id.
cuda()
Creates a CUDA device with the provided id.
id
property id*: int*
Returns device id.
is_host
property is_host
Returns whether the device is the CPU.
label
property label*: str*
Returns device label.
stats
Returns utilization data for the device.
DeviceSpec
class max.driver.DeviceSpec(id: 'int', device_type: "Literal['cpu', 'gpu']" = 'cpu')
cpu()
static cpu(id: int = -1)
cuda()
static cuda(id: int = -1)
device_type
device_type*: Literal['cpu', 'gpu']* = 'cpu'
Type of specified device.
id
id*: int*
Provided id for this device.
MemMapTensor
class max.driver.MemMapTensor(filename: PathLike, dtype: DType, shape: Sequence[int], mode='r+', offset=0)
Create a memory-mapped tensor from a binary file on disk.
The constructor argument semantics follow that of np.memmap.
read_only
property read_only*: bool*