mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-06 17:49:07 -05:00
[PR #1391] [MERGED] feat(tinytorch): add ndim, numel(), contiguous() to Tensor #8159
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1391
Author: @profvjreddi
Created: 4/17/2026
Status: ✅ Merged
Merged: 4/17/2026
Merged by: @profvjreddi
Base:
dev← Head:feat/tinytorch📝 Commits (2)
eaee587Merge dev into feat/tinytorch3bbf2ebfeat(tinytorch): add ndim, numel(), contiguous() to Tensor (closes #1298)📊 Changes
1 file changed (+30 additions, -0 deletions)
View changed files
📝
tinytorch/src/01_tensor/01_tensor.py(+30 -0)📄 Description
Summary
ndimproperty,numel(), andcontiguous()to the Tensor classCloses #1298 (partial — covers the safe API aliases;
view(),masked_fill(), and__init__changes deferred)Test plan
ast.parsepython3 -m pytest tinytorch/tests/01_tensor/ -vpassespython3 tinytorch/src/01_tensor/01_tensor.py🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.