Partial¶
- class paddle.distributed. Partial
-
The Partial describes Tensor across multiple devices, this type of tensor has the same shape but only a fraction of the value, which can be further reduce (e.g. sum/min/max) to obtain dist_tensor, often used as an intermediate representation.
- Parameters
-
reduce_type (paddle.distributed.ReduceType) – the reduce type of the Partial state, default paddle.distributed.ReduceType.kRedSum.
Examples
>>> import paddle >>> import paddle.distributed as dist >>> mesh = dist.ProcessMesh([0, 1], dim_names=["x"]) >>> a = paddle.ones([10, 20]) >>> >>> # distributed tensor >>> d_tensor = dist.shard_tensor(a, mesh, [dist.Partial()])
-
is_partial
(
self: paddle.base.libpaddle.Placement
)
bool
is_partial¶
-
is_replicated
(
self: paddle.base.libpaddle.Placement
)
bool
is_replicated¶
-
is_shard
(
self: paddle.base.libpaddle.Placement,
dim: Optional[int] = None
)
bool
is_shard¶