From ebe578098d53e73a6207c75e166f9cdc899b42aa Mon Sep 17 00:00:00 2001 From: Corleone Date: Thu, 1 Dec 2022 16:53:00 +0800 Subject: [PATCH] fix max_unpool3d test sample --- .../python/mindspore/ops/function/nn_func.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mindspore/python/mindspore/ops/function/nn_func.py b/mindspore/python/mindspore/ops/function/nn_func.py index 3ae0a326787..e48acd7d1ee 100644 --- a/mindspore/python/mindspore/ops/function/nn_func.py +++ b/mindspore/python/mindspore/ops/function/nn_func.py @@ -914,7 +914,7 @@ def max_unpool3d(x, indices, kernel_size, stride=None, padding=0, output_size=No :math:`[(N, C, D_{out} - stride[0], H_{out} - stride[1], W_{out} - stride[2]), (N, C, D_{out} + stride[0], H_{out} + stride[1], W_{out} + stride[2])]`. - Outputs: + Returns: Tensor, with shape :math:`(N, C, D_{out}, H_{out}, W_{out})` or :math:`(C, D_{out}, H_{out}, W_{out})`, with the same data type with `x`. @@ -935,11 +935,14 @@ def max_unpool3d(x, indices, kernel_size, stride=None, padding=0, output_size=No Examples: >>> x = Tensor(np.array([[[[[0, 1], [8, 9]]]]]).astype(np.float32)) >>> indices= Tensor(np.array([[[[[0, 1], [2, 3]]]]]).astype(np.int64)) - >>> maxunpool3d = nn.MaxUnpool3d(kernel_size=1, stride=1, padding=0) - >>> output = maxunpool3d(x, indices) - >>> print(output.asnumpy()) - [[[[[0. 1.] - [8. 9.]]]]] + >>> output = ops.max_unpool3d(x, indices, kernel_size=2, stride=1, padding=0) + >>> print(output) + [[[[[0. 1. 8.] + [9. 0. 0.] + [0. 0. 0.]] + [[0. 0. 0.] + [0. 0. 0.] + [0. 0. 0.]]]]] """ if stride is None: stride = 0