!42280 update ops examples
Merge pull request !42280 from panfengfeng/fix_some_issues
This commit is contained in:
commit
9b4db1b646
|
@ -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)
|
||||
|
|
|
@ -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__ = (
|
||||
|
|
Loading…
Reference in New Issue