Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
srush committed Jul 12, 2022
1 parent 33b756a commit 6330cb1
Show file tree
Hide file tree
Showing 26 changed files with 659 additions and 482 deletions.
30 changes: 1 addition & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,6 @@ in a simplified environment. Each puzzle asks you to reimplement one
function in the NumPy standard library without magic.


* [Rules](#Rules)
* [Puzzle 1 - ones](#puzzle-1---ones).
* [Puzzle 2 - sum](#puzzle-2---sum).
* [Puzzle 3 - outer](#puzzle-3---outer).
* [Puzzle 4 - diag](#puzzle-4---diag).
* [Puzzle 5 - eye](#puzzle-5---eye).
* [Puzzle 6 - triu](#puzzle-6---triu).
* [Puzzle 7 - cumsum](#puzzle-7---cumsum).
* [Puzzle 8 - diff](#puzzle-8---diff).
* [Puzzle 9 - vstack](#puzzle-9---vstack).
* [Puzzle 10 - roll](#puzzle-10---roll).
* [Puzzle 11 - flip](#puzzle-11---flip).
* [Puzzle 12 - compress](#puzzle-12---compress).
* [Puzzle 13 - pad_to](#puzzle-13---pad_to).
* [Puzzle 14 - sequence_mask](#puzzle-14---sequence_mask).
* [Puzzle 15 - bincount](#puzzle-15---bincount).
* [Puzzle 16 - scatter_add](#puzzle-16---scatter_add).
* [Puzzle 17 -flatten](#18\)-flatten)
* [linspace](#19\)-linspace)
* [heaviside](#20\)-heaviside)
* [hstack](#21\)-hstack)
* [view](#22\)-view-\(1d-to-2d\))
* [repeat](#23\)-repeat-\(1d\))
* [repeat_interleave](#24\)-repeat_interleave-\(1d\))
* [chunk](#25\)-chunk)
* [nonzero](#26\)-nonzero)
* [bucketize](#27\)-bucketize)


```python
!pip install -qqq torchtyping hypothesis pytest git+https://github.com/danoneata/chalk@srush-patch-1
Expand Down Expand Up @@ -126,7 +98,7 @@ draw_examples("where", [{"q": q, "a":a, "b":b, "ret": where(q, a, b)} for q, a,
2. No cheating. Stackoverflow is great, but this is about first-principles.
3. Hint... these puzzles are mostly about Broadcasting. Make sure you understand this rule.

🐶🐶🐶 After you convince yourself your code is correct, run the cell to test it. If the test succeeds, you will get a puppy 🐶🐶🐶.
After you convince yourself your code is correct, run the cell to test it. If the test succeeds, you will get a puppy 🐶.

![](https://pbs.twimg.com/media/FQywor0WYAssn7Y?format=png&name=large)

Expand Down
877 changes: 424 additions & 453 deletions Tensor Puzzlers.ipynb

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Tensor Puzzlers_files/Tensor Puzzlers_12_0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions Tensor Puzzlers_files/Tensor Puzzlers_15_0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6330cb1

Please sign in to comment.