forked from mindspore-Ecosystem/mindspore
!9581 modify example of ParameterUpdate
From: @zhangbuxue Reviewed-by: @ginfung,@zh_qh Signed-off-by: @zh_qh
This commit is contained in:
commit
5a0ae06bb0
|
@ -403,12 +403,12 @@ class ParameterUpdate(Cell):
|
|||
``Ascend``
|
||||
|
||||
Examples:
|
||||
>>> network = Net()
|
||||
>>> param = network.parameters_dict()['learning_rate']
|
||||
>>> network = nn.Dense(3, 4)
|
||||
>>> param = network.parameters_dict()['weight']
|
||||
>>> update = nn.ParameterUpdate(param)
|
||||
>>> update.phase = "update_param"
|
||||
>>> lr = Tensor(0.001, mindspore.float32)
|
||||
>>> update(lr)
|
||||
>>> weight = Tensor(0.001, mindspore.float32)
|
||||
>>> update(weight)
|
||||
"""
|
||||
|
||||
def __init__(self, param):
|
||||
|
|
Loading…
Reference in New Issue