!48098 fix example docs master

Merge pull request !48098 from 冯一航/code_docs_modify_example_docs_master
This commit is contained in:
i-robot 2023-01-28 06:43:09 +00:00 committed by Gitee
commit 03e968dfb9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 1 deletions

View File

@ -615,7 +615,7 @@ def positive(x):
>>> from mindspore import dtype as mstype
>>> x = Tensor(np.array([-5.0, 1.5, 3.0, 100.0]), mstype.float32)
>>> print(ops.positive(x))
[-5.0, 1.5, 3.0, 100.0]
[ -5. 1.5 3. 100. ]
"""
if not isinstance(x, (Tensor, Tensor_)):
raise TypeError(f"For positive, the input must be a Tensor, but got {type(x)}")

View File

@ -3900,6 +3900,7 @@ def gaussian_nll_loss(x, target, var, full=False, eps=1e-6, reduction='mean'):
>>> target = Tensor(arr2, mstype.float32)
>>> output = ops.gaussian_nll_loss(x, target, var)
>>> print(output)
1.4374993
Reference:
Nix, D. A. and Weigend, A. S., "Estimating the mean and variance of the