jax.local_devices

jax.local_devices#

jax.local_devices(process_index=None, backend=None, host_id=None)[源代码][源代码]#

类似于 jax.devices(),但仅返回给定进程本地的设备。

如果 process_indexNone ,则返回此进程本地的设备。

参数:
  • process_index (int | None) – 进程的整数索引。可以通过 len(jax.process_count()) 获取进程索引。

  • backend (str | xla_client.Client | None) – 这是一个实验性功能,API 可能会发生变化。可选,表示 xla 后端的字符串:'cpu''gpu''tpu'

  • host_id (int | None)

返回:

设备子类列表。

返回类型:

list[xla_client.Device]