torchrl._utils package#
Set of utility methods that are used internally by the library.
|
A version decorator that checks version compatibility and implements functions. |
A context manager or decorator to control whether TransformedEnv should automatically unwrap nested TransformedEnv instances. |
|
|
Get the current setting for automatically unwrapping TransformedEnv instances. |
Memory profiling#
CUDA memory helpers that pair well with timeit for scoping
per-phase allocation peaks in training loops. They are safe to call on
CPU-only / MPS systems (they return zeros and no-op respectively), so the
calls can live unconditionally in device-agnostic code paths.
|
Return current CUDA memory statistics for |
|
Reset the peak-memory counters for |
|
Context manager / decorator that reports CUDA memory deltas for a code block. |