Browse Source

!457 Add comments for print and fix example

Merge pull request !457 from ghzl/add-comments-for-print-and-others
tags/v0.2.0-alpha
mindspore-ci-bot Gitee 5 years ago
parent
commit
25b0a8c394
3 changed files with 8 additions and 5 deletions
  1. +4
    -4
      mindspore/ops/operations/comm_ops.py
  2. +3
    -0
      mindspore/ops/operations/debug_ops.py
  3. +1
    -1
      mindspore/ops/operations/other_ops.py

+ 4
- 4
mindspore/ops/operations/comm_ops.py View File

@@ -65,7 +65,7 @@ class AllReduce(PrimitiveWithInfer):
The contents depend on the specified operation.

Examples:
>>> from mindspore.communication.management import init
>>> from mindspore.communication import init
>>> import mindspore.ops.operations as P
>>> init('nccl')
>>> class Net(nn.Cell):
@@ -130,7 +130,7 @@ class AllGather(PrimitiveWithInfer):
then the shape of output is :math:`(N, x_1, x_2, ..., x_R)`.

Examples:
>>> from mindspore.communication.management import init
>>> from mindspore.communication import init
>>> import mindspore.ops.operations as P
>>> init('nccl')
>>> class Net(nn.Cell):
@@ -187,7 +187,7 @@ class ReduceScatter(PrimitiveWithInfer):
ValueError: If the first dimension of input can not be divided by rank size.

Examples:
>>> from mindspore.communication.management import init
>>> from mindspore.communication import init
>>> import mindspore.ops.operations as P
>>> init('nccl')
>>> class Net(nn.Cell):
@@ -252,7 +252,7 @@ class Broadcast(PrimitiveWithInfer):
TypeError: If root_rank is not a integer or group is not a string.

Examples:
>>> from mindspore.communication.management import init
>>> from mindspore.communication import init
>>> import mindspore.ops.operations as P
>>> init('nccl')
>>> class Net(nn.Cell):


+ 3
- 0
mindspore/ops/operations/debug_ops.py View File

@@ -161,6 +161,9 @@ class Print(PrimitiveWithInfer):
"""
Output tensor or string to stdout.

Note:
The print operation cannot support float64 and bool types currently.

Inputs:
- **input_x** (Union[Tensor, str]) - The graph node to attach to. The input supports
multiple strings and tensors which are separated by ','.


+ 1
- 1
mindspore/ops/operations/other_ops.py View File

@@ -120,7 +120,7 @@ class BoundingBoxDecode(PrimitiveWithInfer):

Examples:
>>> 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)
"""



Loading…
Cancel
Save