CMD + K

tensordict

Community

TensorDict is a pytorch dedicated tensor container.

Installation

To install this package, run one of the following:

Conda
$conda install conda-forge::tensordict

Usage Tracking

0.10.0
0.9.1
0.9.0
0.8.3
0.8.2
5 / 8 versions selected
Downloads (Last 6 months): 0

Description

TensorDict is a dictionary-like class that inherits properties from tensors, such as indexing, shape operations, casting to device or point-to-point communication in distributed settings.

The main purpose of TensorDict is to make code-bases more readable and modular by abstracting away tailored operations:

for i, tensordict in enumerate(dataset):

    tensordict = model(tensordict)
    loss = loss_module(tensordict)
    loss.backward()
    optimizer.step()
    optimizer.zero_grad()

With this level of abstraction, one can recycle a training loop for highly heterogeneous task. Each individual step of the training loop (data collection and transform, model prediction, loss computation etc.) can be tailored to the use case at hand without impacting the others. For instance, the above example can be easily used across classification and segmentation tasks, among many others.

PyPI: https://pypi.org/project/tensordict/


:fire: The conda-forge recipe was generated with Conda-Forger App.

:point_right: Streamlit App

About

Summary

TensorDict is a pytorch dedicated tensor container.

Last Updated

Sep 4, 2025 at 12:45

License

MIT

Total Downloads

140.2K

Supported Platforms

macOS-64
linux-64

Unsupported Platforms

noarch Last supported version: 0.1.2