Remove disable_jit in test.
PiperOrigin-RevId: 614824680 Change-Id: I15f1441dfb1a70b98e5a221c0e15b06572860748
This commit is contained in:
committed by
Copybara-Service
parent
8413a615d7
commit
a49f3f63fc
@@ -297,8 +297,7 @@ class ConvexTest(absltest.TestCase):
|
|||||||
|
|
||||||
def test_flat_box_plane(self):
|
def test_flat_box_plane(self):
|
||||||
"""Tests box collision with a plane."""
|
"""Tests box collision with a plane."""
|
||||||
with jax.disable_jit():
|
d, dx = _collide(self._FLAT_BOX_PLANE)
|
||||||
d, dx = _collide(self._FLAT_BOX_PLANE)
|
|
||||||
|
|
||||||
np.testing.assert_array_less(dx.contact.dist, 0)
|
np.testing.assert_array_less(dx.contact.dist, 0)
|
||||||
|
|
||||||
@@ -586,25 +585,24 @@ class TopKContactTest(absltest.TestCase):
|
|||||||
|
|
||||||
def test_max_pair(self):
|
def test_max_pair(self):
|
||||||
"""Tests contact culling before the collision functions were dispatched."""
|
"""Tests contact culling before the collision functions were dispatched."""
|
||||||
with jax.disable_jit():
|
m = mujoco.MjModel.from_xml_string(self._CAPSULES_MAX_PAIR)
|
||||||
m = mujoco.MjModel.from_xml_string(self._CAPSULES_MAX_PAIR)
|
mx_top_k = mjx.put_model(m)
|
||||||
mx_top_k = mjx.put_model(m)
|
mx_all = mx_top_k.replace(
|
||||||
mx_all = mx_top_k.replace(
|
nnumeric=0, name_numericadr=np.array([]), numeric_data=np.array([])
|
||||||
nnumeric=0, name_numericadr=np.array([]), numeric_data=np.array([])
|
)
|
||||||
)
|
d = mujoco.MjData(m)
|
||||||
d = mujoco.MjData(m)
|
dx = mjx.put_data(m, d)
|
||||||
dx = mjx.put_data(m, d)
|
|
||||||
|
|
||||||
collision_jit_fn = jax.jit(mjx.collision)
|
collision_jit_fn = jax.jit(mjx.collision)
|
||||||
kinematics_jit_fn = jax.jit(mjx.kinematics)
|
kinematics_jit_fn = jax.jit(mjx.kinematics)
|
||||||
dx = kinematics_jit_fn(mx_all, dx)
|
dx = kinematics_jit_fn(mx_all, dx)
|
||||||
|
|
||||||
dx_all = collision_jit_fn(mx_all, dx)
|
dx_all = collision_jit_fn(mx_all, dx)
|
||||||
dx_top_k = collision_jit_fn(mx_top_k, dx)
|
dx_top_k = collision_jit_fn(mx_top_k, dx)
|
||||||
|
|
||||||
self.assertEqual(dx_all.contact.dist.shape, (6,))
|
self.assertEqual(dx_all.contact.dist.shape, (6,))
|
||||||
self.assertEqual(dx_top_k.contact.dist.shape, (2,))
|
self.assertEqual(dx_top_k.contact.dist.shape, (2,))
|
||||||
self.assertTrue((dx_top_k.contact.dist < 0).all())
|
self.assertTrue((dx_top_k.contact.dist < 0).all())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user