mlx.core.async_eval

目录

mlx.core.async_eval#

async_eval(*args)#

Asynchronously evaluate an array or tree of 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)