HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
pytorch
tensordict
Python2024–2024
pytorch / tensordict

tensordict

A dict[str, torch.Tensor] that behaves like one tensor, and TensorClass: typed, batched dataclasses that compile.

2Distinct people
3Mentions
0Explicit recommenders
1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A dict[str, torch.Tensor] that behaves like one tensor, and TensorClass: typed, batched dataclasses that compile.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by week3 dated mentions

Observed mentions: 2024-08-02 15:54:40 UTC to 2024-11-23 03:22:05 UTC. Weeks start Monday, UTC.

0122024-07-29 00:00:00 UTC to 2024-08-05 00:00:00 UTC (exclusive): 2 mentions; 2 submissions, 0 commentsJul 292024-08-05 00:00:00 UTC to 2024-08-12 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-08-12 00:00:00 UTC to 2024-08-19 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-08-19 00:00:00 UTC to 2024-08-26 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-08-26 00:00:00 UTC to 2024-09-02 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-09-02 00:00:00 UTC to 2024-09-09 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-09-09 00:00:00 UTC to 2024-09-16 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-09-16 00:00:00 UTC to 2024-09-23 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-09-23 00:00:00 UTC to 2024-09-30 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsSep 232024-09-30 00:00:00 UTC to 2024-10-07 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-10-07 00:00:00 UTC to 2024-10-14 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-10-14 00:00:00 UTC to 2024-10-21 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-10-21 00:00:00 UTC to 2024-10-28 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-10-28 00:00:00 UTC to 2024-11-04 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-11-04 00:00:00 UTC to 2024-11-11 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-11-11 00:00:00 UTC to 2024-11-18 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-11-18 00:00:00 UTC to 2024-11-25 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsNov 18

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Jul 292024-07-29 00:00:00 UTC2024-08-05 00:00:00 UTC220
Aug 52024-08-05 00:00:00 UTC2024-08-12 00:00:00 UTC000
Aug 122024-08-12 00:00:00 UTC2024-08-19 00:00:00 UTC000
Aug 192024-08-19 00:00:00 UTC2024-08-26 00:00:00 UTC000
Aug 262024-08-26 00:00:00 UTC2024-09-02 00:00:00 UTC000
Sep 22024-09-02 00:00:00 UTC2024-09-09 00:00:00 UTC000
Sep 92024-09-09 00:00:00 UTC2024-09-16 00:00:00 UTC000
Sep 162024-09-16 00:00:00 UTC2024-09-23 00:00:00 UTC000
Sep 232024-09-23 00:00:00 UTC2024-09-30 00:00:00 UTC000
Sep 302024-09-30 00:00:00 UTC2024-10-07 00:00:00 UTC000
Oct 72024-10-07 00:00:00 UTC2024-10-14 00:00:00 UTC000
Oct 142024-10-14 00:00:00 UTC2024-10-21 00:00:00 UTC000
Oct 212024-10-21 00:00:00 UTC2024-10-28 00:00:00 UTC000
Oct 282024-10-28 00:00:00 UTC2024-11-04 00:00:00 UTC000
Nov 42024-11-04 00:00:00 UTC2024-11-11 00:00:00 UTC000
Nov 112024-11-11 00:00:00 UTC2024-11-18 00:00:00 UTC000
Nov 182024-11-18 00:00:00 UTC2024-11-25 00:00:00 UTC110

What Hacker News says

3 sources
vmoens·Aug 3, 2024Submission

Show HN: TensorDict, GPU-accelerated Python dicts

If you're working with multiple torch.Tensor objects, you've probably got a lot of boilerplate code you'd like to get rid of. And if the collection of tensors is large enough, chances are that you're also struggling with finding the right schedule to dispatch operations to all of these. That's where TensorDict comes in - it's a PyTorch primitive that makes it easy to build dictionaries of tensors (and non-tensors) with a focus on composability and performance. Convenience: With TensorDict, you can easily apply an op to a collection of tensors, eliminating the need for tedious loops and improving the code's readability. The API is designed to be intuitive, mirroring the torch.Tensor's one (e.g., `TensorDict.cuda()`, `TensorDict.chunk()` etc), so you can reshape, split, concatenate, clone, and more with familiar syntax. Speed: That's not al
Read the rest
l - TensorDict also optimizes operations under the hood, resulting in significant speedups. For example, casting a large collection of tensors to GPU can be up to 2x faster than using a regular Python loop. We used fused CUDA kernels for arithmetic ops so you can code an optimizer like ADAM in 5 lines of code (like you would do for a single tensor) and it will run much faster in eager and compile modes than you would have done with a regular for loop over your tensors. Plus, our library comes with a GPU-accelerated dataclass (@tensorclass) for those who want to set in stone the content of their data structure. Other key features include: - torch.compile (PT2) compatibility - Consolidation into a single storage for fast node-to-node communication - Support for memory-mapping and shared memory TensorDict can be used as lightweight substitute to a dataloader thanks to `TensorDict.map_iter`, and do preproc on-device, outperforming regular dataloading speed by orders of magnitude (check the tutorials!) Finally, if you're worried about added complexity, remember that TensorDict can be used as a drop-in replacement for `dict` (as it accepts non-tensor data too). We're excited to share TensorDict with the community and invite your feedback and contributions! Try it out and let us know what you think!
2 points · Open discussion

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.