蒙冤者援助计划丨福建宁德缪新华杀人分尸案调查

paddle.distributed. reshard ( dist_tensor: Tensor, mesh: ProcessMesh, placements: list[Placement] ) Tensor [source]
百度   首先,落户等激励措施对应的人才评判体系,跟纯市场的人才标准是契合的。

Reshard a distributed paddle.Tensor with given distributed attributes.

Parameters
  • dist_tensor (Tensor) – the distributed tensor to be resharded.

  • mesh (paddle.distributed.ProcessMesh) – The ProcessMesh object describes the Cartesian topology of the used processes.

  • placements (list[paddle.distributed.Placement]) – the placements describe how to place the tensor on ProcessMesh, it can be Shard, Replicate and Partial.

Returns

A Distributed Tensor resharded with distributed attributes.

Return type

Tensor

Examples

>>> import paddle
>>> import paddle.distributed as dist

>>> mesh = dist.ProcessMesh([0, 1], dim_names=["x"])

>>> # dense tensor
>>> a = paddle.ones([10, 20])

>>> 
>>> # distributed tensor
>>> d_tensor = dist.shard_tensor(a, mesh, [dist.Partial()])

>>> out_d_tensor = dist.reshard(d_tensor, mesh, [dist.Replicate()])

>>> print(out_d_tensor)