facebookresearch / theseus

A library for differentiable nonlinear optimization
MIT License
1.78k stars 128 forks source link

`Objective.update()` allows passing tensors not consistent with `self.device` #569

Closed luisenp closed 1 year ago

luisenp commented 1 year ago

Objective.update() allows passing tensors not consistent with self.device. If update() is used to update all the variables in the objective, NLLS optimizers will generate delta on the objective's original device, and then get a runtime error when trying to retract variables that are in a different device.