--- id: tensordict-nightly version: "2026.8.14" license: BSD license_treatment: permissive maintenance: active --- # tensordict-nightly — TensorDict is a pytorch dedicated tensor container. License: permissive · Maintenance: active · Downloads: 188.5K/mo ## What it is and what it does TensorDict is a container that wraps multiple PyTorch tensors into a single batched, nested structure while preserving tensor semantics. Instead of manually managing a collection of tensors with aligned batch dimensions, you create a TensorDict once and then slice, reshape, move to device, or perform arithmetic on the entire structure as if it were a single tensor. Every operation applies uniformly to all leaf tensors, keeping the batch dimension honest. It is designed for data-heavy PyTorch workflows—training loops, reinforcement learning rollouts, parameter ensembles, and offline datasets—where the natural unit of data is not one tensor but a structured collection. The package includes memory-mapped I/O, lazy stacking, functional parameter handling, and torch.compile support to reduce boilerplate and improve performance in large systems. Use it for: - Training loops where a single batch object flows through dataset, model, and loss without unpacking and repacking tensors. - Reinforcement learning environments that need to track nested state (agent policy, value, environment reward, done flags) with synchronized batch operations. - Offline datasets and replay buffers that benefit from memory-mapped storage and efficient slicing across many tensor leaves. - Functional training with parameter ensembles, where module weights are held in a TensorDict and swapped in and out of modules. - Multi-agent or hierarchical systems with nested data structures (e.g., agents.policy, env.reward) that need uniform batch semantics. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. TensorDict is a batched, nested dictionary container for PyTorch tensors that behaves like a single tensor—enabling slicing, reshaping, device transfer, and arithmetic operations across all leaves simultaneously while maintaining a shared batch size. Yes. TensorDict is actively maintained, has no known vulnerabilities, and is widely used in PyTorch RL and training systems. Install the nightly release if you are comfortable with frequent updates; otherwise, wait for a stable release. It is worth installing if you work with structured tensor batches and want to eliminate manual dimension tracking and repetitive tensor operations. ## Install pip install tensordict-nightly uv add tensordict-nightly poetry add tensordict-nightly ## Installing tensordict-nightly Before you install: Nightly release with active maintenance (last commit 2026-08-14) and broad platform coverage across Python 3.10–3.14 on macOS, Linux, and Windows. Medium install friction due to compiled wheels; no known vulnerabilities. License in practice: BSD permissive license allows commercial and private use with minimal restrictions; suitable for most projects. Quickstart: pip install tensordict-nightly import torch from tensordict import TensorDict batch = TensorDict( {"obs": torch.randn(32, 128), "action": torch.randint(0, 4, (32,))}, batch_size=[32], ) mini = batch[:8] # slices all leaves on_device = batch.to("cuda") # moves all leaves Requires PyTorch (torch) and modern Python (3.10+); compiled wheels available for common platforms. Verify before relying: - Whether nightly releases receive the same stability guarantees as stable releases - Performance overhead of TensorDict operations compared to manual tensor handling in specific workloads ## Package facts - License: BSD (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 188.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags batched tensor dictionary, nested tensor container pytorch, tensor batch operations, structured tensor data, pytorch tensor dict, batch-aware tensor structure, tensor collection management, pytorch-ecosystem, tensor-containers, batch-operations [View on SkillFed](https://skillfed.io/packages/tensordict-nightly) · [View on PyPI](https://pypi.org/project/tensordict-nightly/)