Update 'place' doc

This commit is contained in:
ZPaC 2023-01-19 10:06:56 +08:00
parent eeeb1e3d7c
commit 9e5db04de3
2 changed files with 5 additions and 1 deletions

View File

@ -2137,8 +2137,10 @@ class Cell(Cell_):
The rank is unique in processes with the same role.
Examples:
>>> from mindspore import context
>>> import mindspore.nn as nn
>>> fc = nn.Dense()
>>> context.set_context(mode=context.GRAPH_MODE)
>>> fc = nn.Dense(2, 3)
>>> fc.place('MS_WORKER', 0)
"""
all_ops = self._get_prims_recursively()

View File

@ -426,7 +426,9 @@ class Primitive(Primitive_):
The rank_id is unique in processes with the same role.
Examples:
>>> from mindspore import context
>>> import mindspore.ops as ops
>>> context.set_context(mode=context.GRAPH_MODE)
>>> matmul = ops.MatMul()
>>> matmul.place('MS_WORKER', 0)
"""