@@ -322,16 +322,8 @@ def _put_option(
322322 raise NotImplementedError (f'Unsupported implementation: { impl } ' )
323323
324324
325- def _put_statistic (
326- s : mujoco .MjStatistic , impl : types .Impl
327- ) -> Union [types .Statistic , types .StatisticWarp ]:
325+ def _put_statistic (s : mujoco .MjStatistic ) -> types .Statistic :
328326 """Puts mujoco.MjStatistic onto a device, resulting in mjx.Statistic."""
329- if impl == types .Impl .WARP :
330- fields = {
331- f .name : _wp_to_np_type (getattr (s , f .name , None ), f .name )
332- for f in types .StatisticWarp .fields ()
333- }
334- return types .StatisticWarp (** fields )
335327 return types .Statistic (
336328 meaninertia = s .meaninertia ,
337329 meanmass = s .meanmass ,
@@ -424,7 +416,7 @@ def _put_model_jax(
424416 fields = {f : getattr (m , f ) for f in mj_field_names }
425417 fields ['cam_mat0' ] = fields ['cam_mat0' ].reshape ((- 1 , 3 , 3 ))
426418 fields ['opt' ] = _put_option (m .opt , types .Impl .JAX )
427- fields ['stat' ] = _put_statistic (m .stat , types . Impl . JAX )
419+ fields ['stat' ] = _put_statistic (m .stat )
428420
429421 fields_jax = {}
430422 fields_jax ['dof_hasfrictionloss' ] = fields ['dof_frictionloss' ] > 0
@@ -495,7 +487,7 @@ def _put_model_warp(
495487 private_options = {k : getattr (mw .opt , k ) for k in option_keys }
496488 private_options ['graph_mode' ] = graph_mode
497489 fields ['opt' ] = _put_option (m .opt , types .Impl .WARP , private_options )
498- fields ['stat' ] = _put_statistic (m .stat , types . Impl . WARP )
490+ fields ['stat' ] = _put_statistic (m .stat )
499491
500492 # Use MJW fields directly instead of MjModel, so that shape and dtype are
501493 # always compatible with MJXW (e.g. cam_mat0/geom_aabb).
@@ -544,7 +536,7 @@ def _put_model_cpp(
544536 fields = {f : getattr (m , f ) for f in mj_field_names }
545537 fields ['cam_mat0' ] = fields ['cam_mat0' ].reshape ((- 1 , 3 , 3 ))
546538 fields ['opt' ] = _put_option (m .opt , impl = types .Impl .JAX )
547- fields ['stat' ] = _put_statistic (m .stat , impl = types . Impl . JAX )
539+ fields ['stat' ] = _put_statistic (m .stat )
548540
549541 # get the pointer address
550542 # we use a 0-d array
0 commit comments