map

ivy.map(fn: Callable, constant: Optional[Dict[str, Any]] = None, unique: Optional[Dict[str, Iterable[Any]]] = None, mean: bool = False) → List[source]

Applies a function on each item of an iterable x.

Parameters
  • fn (callable) – The function to map onto x.

  • constant (dict of any, optional) – keyword arguments which remain constant between each function call. Default is None.

  • unique (dict of iterables of any, optional) – keyword arguments which are unique for each function call. Default is None.

  • mean (bool, optional) – Whether to compute the mean across the return values, and return this mean. Default is False.

Returns

x following the applicable of fn to each of it’s iterated items.


Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty