jax.Array.committed#

abstract 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.ac.cn/en/latest/faq.html#controlling-data-and-computation-placement-on-devices