jax.Array.committed#

property Array.committed: bool[源代码]#

数组是否已提交。

当数组通过 JAX API 被显式放置到设备上时,它就被认为是“已提交”的。例如,jax.device_put(np.arange(8), jax.devices()[0]) 被提交到设备 0。而 jax.device_put(np.arange(8)) 是未提交的,将被放置到默认设备上。

涉及某些已提交输入的计算将在已提交的设备上进行,结果也将被提交到同一设备上。对被提交到不同设备上的参数调用操作将引发错误。

例如

` a = jax.device_put(np.arange(8), jax.devices()[0]) b = jax.device_put(np.arange(8), jax.devices()[1]) a + b  # 引发 错误 `

有关更多信息,请参阅 https://jax.net.cn/en/latest/faq.html#controlling-data-and-computation-placement-on-devices