14岁女孩1个月2次自杀:埋怨单亲爸爸“不听话”
- paddle.distributed. scatter_object_list ( out_object_list: list[Any], in_object_list: list[Any] | None = None, src: int = 0, group: Group | None = None ) None [source]
-
百度 新京报:吴英有没有告诉你她目前的想法? 吴永正:她想要坚持申诉,同时也希望尽早偿还债权人的债务。
Scatter picklable objects from the source to all others. Similar to scatter(), but python object can be passed in.
- Parameters
-
out_object_list (list) – The list of objects to store the scattered objects.
in_object_list (list) – The list of objects to scatter. Only objects on the src rank will be scattered.
src (int) – The source rank in global view.
group (Group) – The group instance return by new_group or None for global default group.
- Returns
-
None.
Warning
This API only supports the dygraph mode.
Examples
>>> >>> import paddle.distributed as dist >>> dist.init_parallel_env() >>> out_object_list = [] # type: ignore >>> if dist.get_rank() == 0: ... in_object_list = [{'foo': [1, 2, 3]}, {'foo': [4, 5, 6]}] >>> else: ... in_object_list = [{'bar': [1, 2, 3]}, {'bar': [4, 5, 6]}] >>> dist.scatter_object_list(out_object_list, in_object_list, src=1) >>> print(out_object_list) >>> # [{'bar': [1, 2, 3]}] (2 GPUs, out for rank 0) >>> # [{'bar': [4, 5, 6]}] (2 GPUs, out for rank 1)