rlmesh.torch

Experimental Torch-backed RLMesh clients and tensor helpers.

Experimentalimport rlmesh.torch

The Torch backend (experimental): the same clients, models, and sandbox sessions as the top-level package, with tensor leaves decoded to Torch tensors.

pip install "rlmesh[torch]"

Memory sharing and mutation

Decoded observations are owned, writable copies, so a model can normalize in place (img.div_(255)) without touching the wire buffer. as_tensor() is the zero-copy opt-in: the result shares memory with the RLMesh tensor over DLPack.

  • Decode uses torch.utils.dlpack.from_dlpack; bool tensors fall back to a buffer copy before Torch 2.2.
  • uint16, uint32, and uint64 need Torch 2.3 or newer.
  • from_tensor() detaches, moves to CPU, and exports over DLPack; NumPy is not required.

Classes

Functions

Type aliases