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