{"categories":[{"label":"Artificial Intelligence","url":"https://skillfed.io/packages/category/scientific-engineering-artificial-intelligence/2"}],"enrichment":{"capability":"TensorDict is a batched, nested dictionary container that behaves like a PyTorch tensor, allowing you to slice, reshape, move, and perform arithmetic on structured data while keeping all nested tensors synchronized.","skillfed_tags":["pytorch-native","batching-framework","rl-infrastructure"],"use_cases":["Reinforcement learning: pass a single batch through environment, model, and loss without unpacking and repacking nested state.","Offline dataset pipelines: store large replay buffers or training datasets with memory-mapped TensorDicts to reduce peak memory.","Ensemble or multi-agent training: hold parameter sets or agent states as nested TensorDicts and vectorize operations over them.","Model checkpointing: save and load structured intermediate state (activations, gradients, module parameters) in a unified format.","Functional programming: extract module parameters into a TensorDict, swap them in and out, and compose with torch.vmap for vectorized inference.","Data loading and preprocessing: unify heterogeneous tensor batches (images, metadata, labels) into one container that moves and reshapes atomically."],"what_it_does":"TensorDict is a PyTorch container that wraps nested dictionaries of tensors and treats them as a single batched unit. Instead of manually keeping track of batch dimensions across multiple tensors or repeating operations like `.to(device)` and slicing on each leaf, you work with one TensorDict object that synchronizes all its nested tensors. Every operation\u2014indexing, reshaping, device transfer, arithmetic\u2014applies uniformly to every leaf tensor while maintaining a shared batch_size that validates the structure.\n\nIt is built for data-heavy machine learning workflows where the unit of computation is not a single tensor but a collection of related tensors (e.g., observations, actions, rewards, and next-state observations in reinforcement learning, or parameter sets in ensemble training). TensorDict integrates with PyTorch's ecosystem, including torch.compile for performance-critical paths, and provides utilities for memory-mapped storage, lazy stacking, and functional parameter manipulation.","worth_installing":"Yes, if you work with structured tensor data in PyTorch (RL, multi-agent systems, ensemble training, or complex batched workflows). TensorDict eliminates boilerplate for keeping nested tensors synchronized and integrates well with modern PyTorch (torch.compile, vmap). Install friction is moderate due to torch dependency, but precompiled wheels and active maintenance make it straightforward. No known vulnerabilities. BSD license poses no restrictions."},"id":"tensordict","links":{"html":"https://skillfed.io/packages/tensordict","md":"https://skillfed.io/packages/tensordict.md","pypi":"https://pypi.org/project/tensordict/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-06-04","license_spdx":null,"license_treatment":"permissive","name":"tensordict","python_support":"supports_current","summary":"TensorDict is a pytorch dedicated tensor container."},"popularity":{"monthly_downloads":2621852,"position":2967,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.13.0"}
