Skip to main content

Device

This class represents a hardware device configuration, specifying the device type, quantity, and optional partitioning details. It ensures valid resource allocation by enforcing a minimum quantity and supports various device classes and specific hardware models like GPUs or TPUs.

Attributes​

AttributeTypeDescription
quantityintThe number of devices of this type, which must be an integer of at least 1.
device_classDeviceClassThe category or classification of the hardware device.
device`strNone` = null
partition`strNone` = null

Constructor​

Signature​

def Device(
quantity: int,
device_class: DeviceClass,
device: str | None = None,
partition: str | None = None
) -> null

Parameters​

NameTypeDescription
quantityintThe number of devices of this type.
device_classDeviceClassThe classification category of the device.
device`strNone` = None
partition`strNone` = None