Skip to content

Commit b04a29a

Browse files
committed
prohibit hibernation when requires grad
1 parent 597654c commit b04a29a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

genesis/engine/solvers/rigid/rigid_solver_decomp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,12 @@ def build(self):
272272
n_equalities_candidate=self.n_equalities_candidate,
273273
hibernation_thresh_acc=getattr(self, "_hibernation_thresh_acc", 0.0),
274274
hibernation_thresh_vel=getattr(self, "_hibernation_thresh_vel", 0.0),
275-
requires_grad=True, # getattr(self._sim.options, "requires_grad", False), TODO: change to getattr, True for debugging
275+
requires_grad=getattr(self._sim.options, "requires_grad", False),
276276
)
277277

278+
if self._static_rigid_sim_config.requires_grad and self._static_rigid_sim_config.use_hibernation:
279+
gs.raise_exception("Hibernation is not supported when requires_grad is True")
280+
278281
# Add terms for static inner loops, use 0 if not requires_grad to avoid re-compilation
279282
self._static_rigid_sim_config.max_n_links_per_entity = (
280283
getattr(self, "_max_n_links_per_entity", 0) if self._static_rigid_sim_config.requires_grad else 0

0 commit comments

Comments
 (0)