For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python function
local_map
local_map()
max.experimental.nn.common_layers.functional_kernels.local_map(fn, distributed_kwargs, kwargs)
Applies a single-device function independently to each device’s data.
-
Parameters:
-
- fn (Callable[[...], Any]) – Single-device function invoked once per device with keyword arguments.
- distributed_kwargs (Mapping[str, Any]) – Per-device arguments to unroll. A distributed
Tensorcontributes itslocal_shards[i]; alist/tuplebundle contributes elementi(one entry per device); a non-distributedTensorbroadcasts whole. - kwargs (Mapping[str, Any]) – Broadcast arguments passed unchanged to every
fncall.
-
Returns:
-
A
listof per-device results for a single-outputfn, or atupleof such lists whenfnreturns multiple values. -
Return type: