MCPcopy Create free account
hub / github.com/apache/singa / update

Method update

python/singa/opt.py:134–144  ·  view source on GitHub ↗

Update the param values with given gradients. Args: param(Tensor): param values to be updated in-place grad(Tensor): param gradients; the values may be updated in this function; do not use it anymore

(self, param, grad)

Source from the content-addressed store, hash-verified

132 "Update is deprecated, use apply() to do update, refer to apply for more details."
133 )
134 def update(self, param, grad):
135 """Update the param values with given gradients.
136
137 Args:
138 param(Tensor): param values to be updated in-place
139 grad(Tensor): param gradients; the values may be updated
140 in this function; do not use it anymore
141 """
142 if param.name is None:
143 param.name = id(param)
144 self.apply(param.name, param, grad)
145
146 def device_check(self, *inputs):
147 flag = inputs[0].device.graph_enabled()

Callers

nothing calls this directly

Calls 1

applyMethod · 0.95

Tested by

no test coverage detected