Discover and explore top open-source AI tools and projects—updated daily.
pytorchPyTorch tensor container for efficient ML data handling
Top 36.8% on SourcePulse
Summary
TensorDict addresses the complexity of managing multiple PyTorch tensors in machine learning workflows. It provides a dictionary-like container that inherits tensor properties, enabling developers to write more compact, readable, and efficient code for data manipulation, especially in research and large-scale ML applications.
How It Works
TensorDict introduces a specialized dictionary (TensorDict) and a tensor-aware dataclass (tensorclass). It generalizes standard PyTorch tensor operations—such as indexing, slicing, concatenation, and device casting—to collections of tensors, allowing them to be manipulated as a single unit. This approach simplifies code by abstracting repetitive operations and enables asynchronous device transfers for performance gains, while also supporting nested structures and compatibility with torch.compile and torch.vmap.
Quick Start & Requirements
Installation is straightforward via pip: pip install tensordict. For the latest features, use pip install tensordict-nightly. Conda users can install with conda install -c conda-forge tensordict. PyTorch is a core dependency. While basic usage doesn't require specific hardware, examples demonstrate CUDA acceleration.
Highlighted Details
torch.compile for optimized execution.torch.vmap.Maintenance & Community
No specific details regarding maintainers, community channels (like Discord/Slack), or roadmap were provided in the README snippet.
Licensing & Compatibility
TensorDict is released under the permissive MIT License, allowing for broad compatibility with commercial and closed-source projects.
Limitations & Caveats
No explicit limitations, alpha status, or known issues were detailed in the provided README content. The availability of a -nightly build suggests active development.
20 hours ago
Inactive
microsoft
volcengine
ELS-RD
alibaba
ByteDance-Seed
gpu-mode
pytorch