!10067 fix bugs of op AvgPool2d, Conv2dBnFoldQuantOneConv, ApplyAdadelta, ApplyAdagradV2, ApplyPowerSign and so on

From: @lihongkang1
Reviewed-by: @liangchenghui,@wuxuejian
Signed-off-by: @liangchenghui
pull/10067/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit a350613b72

@ -383,8 +383,10 @@ class BatchNorm2d(_BatchNorm):
>>> print(output)
[[[[171.99915 46.999763 ]
[116.99941 191.99904 ]]
[[ 66.999664 250.99875 ]
[194.99902 102.99948 ]]
[[ 8.999955 210.99895 ]
[ 20.999895 241.9988 ]]]]
"""

@ -111,11 +111,8 @@ class MaxPool2d(_PoolNd):
>>> pool = nn.MaxPool2d(kernel_size=3, stride=1)
>>> x = Tensor(np.random.randint(0, 10, [1, 2, 4, 4]), mindspore.float32)
>>> output = pool(x)
>>> print(output)
[[[[7. 8.]
[9. 9.]]
[[7. 8.]
[8. 8.]]]]
>>> print(output.shape)
(1, 2, 2, 2)
"""
def __init__(self, kernel_size=1, stride=1, pad_mode="valid", data_format="NCHW"):
@ -256,11 +253,8 @@ class AvgPool2d(_PoolNd):
>>> pool = nn.AvgPool2d(kernel_size=3, stride=1)
>>> x = Tensor(np.random.randint(0, 10, [1, 2, 4, 4]), mindspore.float32)
>>> output = pool(x)
>>> print(output)
[[[[4.888889 4.4444447]
[4.111111 3.4444444]]
[[4.2222223 4.5555553]
[3.2222223 4.5555553]]]]
>>> print(output.shape)
(1, 2, 2, 2)
"""
def __init__(self,

@ -375,7 +375,7 @@ class Conv2dBnFoldQuantOneConv(Cell):
Examples:
>>> qconfig = compression.quant.create_quant_config()
>>> conv2d_bnfold = nn.Conv2dBnFoldQuant(1, 6, kernel_size=(2, 2), stride=(1, 1), pad_mode="valid",
>>> quant_config=qconfig)
... quant_config=qconfig)
>>> input = Tensor(np.random.randint(-2, 2, (2, 1, 3, 3)), mindspore.float32)
>>> result = conv2d_bnfold(input)
>>> output = result.shape

@ -249,12 +249,13 @@ class SoftmaxCrossEntropyWithLogits(_Loss):
Examples:
>>> loss = nn.SoftmaxCrossEntropyWithLogits(sparse=True)
>>> np.random.seed(0)
>>> logits = Tensor(np.random.randint(0, 9, [1, 10]), mindspore.float32)
>>> labels_np = np.ones([1,]).astype(np.int32)
>>> labels = Tensor(labels_np)
>>> output = loss(logits, labels)
>>> print(output)
[5.6924148]
[7.868383]
"""
def __init__(self,
sparse=False,

File diff suppressed because it is too large Load Diff

@ -318,11 +318,8 @@ class IOU(PrimitiveWithInfer):
>>> anchor_boxes = Tensor(np.random.randint(1.0, 5.0, [3, 4]), mindspore.float16)
>>> gt_boxes = Tensor(np.random.randint(1.0, 5.0, [3, 4]), mindspore.float16)
>>> output = iou(anchor_boxes, gt_boxes)
>>> print(output)
[[65500. 65500. 65500.]
[ -0. -0. -0.]
[ -0. -0. -0.]]
>>> print(output.shape)
(3, 3)
"""
@prim_attr_register

Loading…
Cancel
Save