!391 Modify examples of ApplyMomentum/ArgMax

Merge pull request !391 from Simson/push-to-opensource
This commit is contained in:
mindspore-ci-bot 2020-04-16 20:41:27 +08:00 committed by Gitee
commit 82cfe347fb
2 changed files with 2 additions and 7 deletions

View File

@ -983,8 +983,7 @@ class Argmax(PrimitiveWithInfer):
Examples:
>>> input_x = Tensor(np.array([2.0, 3.1, 1.2]))
>>> index = P.Argmax()(input_x)
>>> assert index == Tensor(1, mindspore.int64)
>>> index = P.Argmax(output_type=mindspore.int32)(input_x)
"""
@prim_attr_register

View File

@ -1345,11 +1345,7 @@ class ApplyMomentum(PrimitiveWithInfer):
Tensor, parameters to be updated.
Examples:
>>> net = ResNet50()
>>> loss = nn.SoftmaxCrossEntropyWithLogits()
>>> opt = P.ApplyMomentum(Tensor(np.array([0.001])), Tensor(np.array([0.9])),
filter(lambda x: x.requires_grad, net.get_parameters()))
>>> model = Model(net, loss, opt)
Please refer to the usage in nn.ApplyMomentum.
"""
__mindspore_signature__ = (
('variable', sig_rw.RW_WRITE, sig_kind.KIND_POSITIONAL_KEYWORD),