mlx.core.async_eval

目錄

mlx.core.async_eval#

async_eval(*args)#

非同步地對 array 或由 array 組成的樹狀結構求值。

備註

This is an experimental API and may change in future versions.

參數:

*args (arrays or trees of arrays) -- Each argument can be a single array or a tree of arrays. If a tree is given the nodes can be a Python list, tuple or dict. Leaves which are not arrays are ignored.

範例

>>> x = mx.array(1.0)
>>> y = mx.exp(x)
>>> mx.async_eval(y)
>>> print(y)
>>>
>>> y = mx.exp(x)
>>> mx.async_eval(y)
>>> z = y + 3
>>> mx.async_eval(z)
>>> print(z)