提交 25b0a8c3 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!457 Add comments for print and fix example

Merge pull request !457 from ghzl/add-comments-for-print-and-others
...@@ -65,7 +65,7 @@ class AllReduce(PrimitiveWithInfer): ...@@ -65,7 +65,7 @@ class AllReduce(PrimitiveWithInfer):
The contents depend on the specified operation. The contents depend on the specified operation.
Examples: Examples:
>>> from mindspore.communication.management import init >>> from mindspore.communication import init
>>> import mindspore.ops.operations as P >>> import mindspore.ops.operations as P
>>> init('nccl') >>> init('nccl')
>>> class Net(nn.Cell): >>> class Net(nn.Cell):
...@@ -130,7 +130,7 @@ class AllGather(PrimitiveWithInfer): ...@@ -130,7 +130,7 @@ class AllGather(PrimitiveWithInfer):
then the shape of output is :math:`(N, x_1, x_2, ..., x_R)`. then the shape of output is :math:`(N, x_1, x_2, ..., x_R)`.
Examples: Examples:
>>> from mindspore.communication.management import init >>> from mindspore.communication import init
>>> import mindspore.ops.operations as P >>> import mindspore.ops.operations as P
>>> init('nccl') >>> init('nccl')
>>> class Net(nn.Cell): >>> class Net(nn.Cell):
...@@ -187,7 +187,7 @@ class ReduceScatter(PrimitiveWithInfer): ...@@ -187,7 +187,7 @@ class ReduceScatter(PrimitiveWithInfer):
ValueError: If the first dimension of input can not be divided by rank size. ValueError: If the first dimension of input can not be divided by rank size.
Examples: Examples:
>>> from mindspore.communication.management import init >>> from mindspore.communication import init
>>> import mindspore.ops.operations as P >>> import mindspore.ops.operations as P
>>> init('nccl') >>> init('nccl')
>>> class Net(nn.Cell): >>> class Net(nn.Cell):
...@@ -252,7 +252,7 @@ class Broadcast(PrimitiveWithInfer): ...@@ -252,7 +252,7 @@ class Broadcast(PrimitiveWithInfer):
TypeError: If root_rank is not a integer or group is not a string. TypeError: If root_rank is not a integer or group is not a string.
Examples: Examples:
>>> from mindspore.communication.management import init >>> from mindspore.communication import init
>>> import mindspore.ops.operations as P >>> import mindspore.ops.operations as P
>>> init('nccl') >>> init('nccl')
>>> class Net(nn.Cell): >>> class Net(nn.Cell):
......
...@@ -161,6 +161,9 @@ class Print(PrimitiveWithInfer): ...@@ -161,6 +161,9 @@ class Print(PrimitiveWithInfer):
""" """
Output tensor or string to stdout. Output tensor or string to stdout.
Note:
The print operation cannot support float64 and bool types currently.
Inputs: Inputs:
- **input_x** (Union[Tensor, str]) - The graph node to attach to. The input supports - **input_x** (Union[Tensor, str]) - The graph node to attach to. The input supports
multiple strings and tensors which are separated by ','. multiple strings and tensors which are separated by ','.
......
...@@ -120,7 +120,7 @@ class BoundingBoxDecode(PrimitiveWithInfer): ...@@ -120,7 +120,7 @@ class BoundingBoxDecode(PrimitiveWithInfer):
Examples: Examples:
>>> boundingbox_decode = P.BoundingBoxDecode(means=(0.0, 0.0, 0.0, 0.0), stds=(1.0, 1.0, 1.0, 1.0), >>> boundingbox_decode = P.BoundingBoxDecode(means=(0.0, 0.0, 0.0, 0.0), stds=(1.0, 1.0, 1.0, 1.0),
max_shape=(768, 1280), wh_ratio_clip=0.016) >>> max_shape=(768, 1280), wh_ratio_clip=0.016)
>>> bbox = boundingbox_decode(anchor_box, deltas) >>> bbox = boundingbox_decode(anchor_box, deltas)
""" """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册