newton.utils.event_scope#

newton.utils.event_scope(fn, name='')[source]#

Wraps a function and records an event before and after the function invocation.

Note

This function has been copied from: google-deepmind/mujoco_warp Then modified to change _STACK from being a global.

Parameters:
  • fn – Function to be wrapped.

  • name (str) – Custom name associated with the function.