For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python function
to_dcp_mesh
to_dcp_mesh()
max.nn.common_layers.context_parallel.to_dcp_mesh(t, mesh)
Moves t between a mesh and its DCP view, moving no data.
One of t.mesh and mesh must be the other’s dcp_view().
Each device keeps its shard, and the placements carry over (see
_view_placements() and _model_placements()). A tensor on
mesh already, or on one device, is returned as it is.
-
Raises:
-
ValueError – If neither mesh is the other’s DCP view.
-
Parameters:
-
- t (Tensor)
- mesh (DeviceMesh)
-
Return type: