Commit ac6d2cd
Speed up warning checking in dm_control.
`MjData.warning.number` is a property, and accessing it incurs a roundtrip penalty to pybind11. Instead, we now grab a reference to the returned array once. Also revert to using `np.copyto` to copy warning states -- we used to do this before the migration to the new bindings, and profiling shows that it is indeed faster.
PiperOrigin-RevId: 465284823
Change-Id: Idf0b2c26134db9fadd52d52c313ae3363c0da8181 parent 58f0821 commit ac6d2cd
1 file changed
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
| 327 | + | |
328 | 328 | | |
329 | | - | |
330 | | - | |
331 | | - | |
| 329 | + | |
332 | 330 | | |
333 | 331 | | |
334 | 332 | | |
| |||
379 | 377 | | |
380 | 378 | | |
381 | 379 | | |
382 | | - | |
| 380 | + | |
383 | 381 | | |
384 | 382 | | |
385 | 383 | | |
| |||
0 commit comments