mlx.core.device_count

mlx.core.device_count#

device_count(device_type: mlx.core.DeviceType) int#

Get the number of available devices for the given device type.

參數:

device_type (DeviceType) -- The type of device to query (cpu or gpu).

回傳:

Number of devices.

回傳型別:

int