unisim.backend.mujoco.tensor_io¶
Persistent packed tensor transfers for the MuJoCo/MJBatch host bridge.
Classes
One stable layout for MuJoCo's unavoidable CPU tensor boundaries. |
- class unisim.backend.mujoco.tensor_io.MuJoCoHostBridgeTransferPlan[source]¶
Bases:
HostBridgeTransferPlanOne stable layout for MuJoCo’s unavoidable CPU tensor boundaries.
CPU physics remains authoritative. The plan removes per-field allocations, metadata lookup, and per-sensor device transfers from the hot path. Each public operation performs at most one packed transfer on the current Torch stream and synchronizes only that stream when crossing to or from CUDA.
- Parameters:
backend (MuJoCoBackend)
spec (TensorIOSpec)
- property spec: TensorIOSpec¶
Return the immutable layout request used to compile this plan.
- property transfer_stats: dict[str, int]¶
Return cumulative semantic transfer and synchronization counters.
- apply_reset(env_indices, qpos, qvel, randomization=None)[source]¶
Pack selected reset rows once, D2H them, and commit CPU physics.
randomizationis the torch-firstTensorResetRandomizationPayload; its plane check and host NumPy conversion happen once in_host_set_state.