!42280 update ops examples

Merge pull request !42280 from panfengfeng/fix_some_issues
This commit is contained in:
i-robot 2022-09-19 07:09:08 +00:00 committed by Gitee
commit 9b4db1b646
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 4 additions and 4 deletions

View File

@ -3596,7 +3596,7 @@ class ApproximateEqual(_LogicBinaryOp):
Examples:
>>> x = Tensor(np.array([1, 2, 3]), mindspore.float32)
>>> y = Tensor(np.array([2, 4, 6]), mindspore.float32)
>>> y = Tensor(np.array([2, 3, 6]), mindspore.float32)
>>> approximate_equal = ops.ApproximateEqual(2.)
>>> output = approximate_equal(x, y)
>>> print(output)

View File

@ -5988,12 +5988,12 @@ class SparseApplyAdagrad(Primitive):
...
>>> net = Net()
>>> grad = Tensor(np.array([[[0.7]]]).astype(np.float32))
>>> indices = Tensor([0], mindspore.int32)
>>> indices = Tensor([1], mindspore.int32)
>>> output = net(grad, indices)
>>> print(output)
(Tensor(shape=[1, 1, 1], dtype=Float32, value=
[[[1.99999988e-01]]]), Tensor(shape=[1, 1, 1], dtype=Float32, value=
[[[1.00000001e-01]]]))
[[[ 2.00000003e-01]]]), Tensor(shape=[1, 1, 1], dtype=Float32, value=
[[[ 1.00000001e-01]]]))
"""
__mindspore_signature__ = (