From ac29213b57db9ff2b9682fe89fee06256a3eafcc Mon Sep 17 00:00:00 2001 From: yuzhenhua Date: Thu, 23 Feb 2023 14:54:53 +0800 Subject: [PATCH] fix full like example code --- mindspore/python/mindspore/ops/function/array_func.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mindspore/python/mindspore/ops/function/array_func.py b/mindspore/python/mindspore/ops/function/array_func.py index 4f098dd4569..f4b11ce97c0 100644 --- a/mindspore/python/mindspore/ops/function/array_func.py +++ b/mindspore/python/mindspore/ops/function/array_func.py @@ -760,11 +760,13 @@ def full_like(x, fill_value, *, dtype=None): ``Ascend`` ``GPU`` ``CPU`` Examples: - >>> output = ops.full_like((2, 2), 1) + >>> input = Tensor([[0, 1], [2, 1]], dtype=mindspore.int32) + >>> output = ops.full_like(input, 1) >>> print(output) [[1. 1.] [1. 1.]] - >>> output = ops.full_like((3, 3), 0) + >>> input = Tensor([[0, 1, 1], [2, 1, 2], [1, 3, 4]], dtype=mindspore.int32) + >>> output = ops.full_like(input, 0) >>> print(output) [[0. 0. 0.] [0. 0. 0.]