Repository navigation
Conversation
Indexing with a list now reads each element as its own region and returns a list of tensors. All windows across regions are computed in one pass (deduplicated and batched together) and stay cached until every region is read. Adds the `sl` helper for building regions with bracket syntax. Lists are no longer treated as a single multi-dimensional index, and non int/slice/Ellipsis index elements now raise TypeError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Processes windows in region order in full batches of batch_size and yields each batch's newly completed regions, so results stream out as they are computed. Accepts lazy iterables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Newer ruff formats Python code blocks in Markdown, which failed the CI format check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tensor[[region_a, region_b, ...]]reads a list of regions in one go. Every window the regions need is computed in a single deduplicated pass, batched whenbatch_sizeis set, and cached until all the regions have been read.InfiniteTensor.iter_regions(regions)processes windows in region order, in full batches ofbatch_size. After each batch it yields the regions that are now complete. It takes lazy iterables, and if a window is evicted before its region is read, it gets recomputed.Test plan
pytest: 91 passed (newTestRegionListIndexingandTestIterRegionscover ordering, batching, laziness, eviction, and empty input)🤖 Generated with Claude Code