mlx.core.vmap#
- vmap(fun: Callable[P, R], in_axes: object = 0, out_axes: object = 0) Callable[P, R]#
Returns a vectorized version of
fun.- 参数:
fun (Callable) -- A function which takes a variable number of
arrayor a tree ofarrayand returns a variable number ofarrayor a tree ofarray.in_axes (int, optional) -- An integer or a valid prefix tree of the inputs to
funwhere each node specifies the vmapped axis. If the value isNonethen the corresponding input(s) are not vmapped. Defaults to0.out_axes (int, optional) -- An integer or a valid prefix tree of the outputs of
funwhere each node specifies the vmapped axis. If the value isNonethen the corresponding outputs(s) are not vmapped. Defaults to0.
- 返回:
The vectorized function.
- 返回类型:
Callable