forked from mindspore-Ecosystem/mindspore
!391 Modify examples of ApplyMomentum/ArgMax
Merge pull request !391 from Simson/push-to-opensource
This commit is contained in:
commit
82cfe347fb
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue