wait

paddle.distributed. wait ( tensor, group=None, use_calc_stream=True ) [source]

wait to sync stream for group.

Parameters
  • tensor (Tensor) – The Tensor used before sync.

  • group (Group) – The Group instance to perform sync.

  • use_calc_stream (bool) – Wether to use calculation stream (True) or communication stream (False). Default to True.

Returns

None.

Examples

>>> 
>>> import paddle

>>> paddle.distributed.init_parallel_env()
>>> tindata = paddle.randn(shape=[2, 3])
>>> paddle.distributed.all_reduce(tindata, sync_op=True)
>>> paddle.distributed.wait(tindata)