Closed rtabbara closed 1 month ago
Picked up when running through the tutorials. Suppose we have
opt = mi.ad.SGD(lr=0.25, params=params) ... y = mi.Float(2.0) opt['y'] = y # A copy should be made here opt['y'] += 1.0
Internally, the Optimizer __setitem__ would perform
Optimizer
__setitem__
... self.variables[key] = dr.detach(value, True)
So in the case that value is not grad-enabled. we still want a copy of the variable to be stored rather than a reference to the original value.
Picked up when running through the tutorials. Suppose we have
Internally, the
Optimizer
__setitem__
would performSo in the case that value is not grad-enabled. we still want a copy of the variable to be stored rather than a reference to the original value.