modify examples of Cast/NMSWithMask

This commit is contained in:
simson 2020-04-17 10:33:46 +08:00
parent 51de42bc05
commit 10877f077e
2 changed files with 2 additions and 3 deletions

View File

@ -174,10 +174,9 @@ class Cast(PrimitiveWithInfer):
Examples:
>>> input_np = np.random.randn(2, 3, 4, 5).astype(np.float32)
>>> input_x = Tensor(input_np)
>>> type_dst = mindspore.int32
>>> type_dst = mindspore.float16
>>> cast = P.Cast()
>>> result = cast(input_x, type_dst)
>>> expect = input_np.astype(type_dst)
"""
@prim_attr_register

View File

@ -1872,7 +1872,7 @@ class NMSWithMask(PrimitiveWithInfer):
>>> bbox = np.random.rand(128, 5)
>>> bbox[:, 2] += bbox[:, 0]
>>> bbox[:, 3] += bbox[:, 1]
>>> inputs = Tensor(bbox)
>>> inputs = Tensor(bbox, mindspore.float32)
>>> nms = P.NMSWithMask(0.5)
>>> output_boxes, indices, mask = nms(inputs)
"""