Skip to content

Commit

Permalink
Merge pull request srush#17 from egodfrey1618/main
Browse files Browse the repository at this point in the history
Minor formatting changes to the README
  • Loading branch information
srush authored Jun 16, 2023
2 parents a20ebcf + 207e653 commit 52c4c7b
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ do most things from first principles and clever use of broadcasting.



This is a collection of 16 tensor puzzles. Like chess puzzles these are
This is a collection of 21 tensor puzzles. Like chess puzzles these are
not meant to simulate the complexity of a real program, but to practice
in a simplified environment. Each puzzle asks you to reimplement one
function in the NumPy standard library without magic.
Expand Down Expand Up @@ -706,19 +706,13 @@ def repeat(a: TT["i"], d: TT[1]) -> TT["d", "i"]:
raise NotImplementedError

test_repeat = make_test("repeat", repeat, repeat_spec, constraint=constraint_set)


# ## Puzzle 21 - bucketize
#
# Compute [bucketize](https://pytorch.org/docs/stable/generated/torch.bucketize.html)
```



![svg](Tensor%20Puzzlers_files/Tensor%20Puzzlers_68_0.svg)


## Puzzle 21 - bucketize

Compute [bucketize](https://pytorch.org/docs/stable/generated/torch.bucketize.html)

```python
def bucketize_spec(v, boundaries, out):
Expand All @@ -741,20 +735,11 @@ def bucketize(v: TT["i"], boundaries: TT["j"]) -> TT["i"]:

test_bucketize = make_test("bucketize", bucketize, bucketize_spec,
constraint=constraint_set)


#
# # Speed Run Mode!
#
# What is the smallest you can make each of these?
```



![svg](Tensor%20Puzzlers_files/Tensor%20Puzzlers_69_0.svg)



## Speed Run Mode!
What is the smallest you can make each of these?

```python
import inspect
Expand Down

0 comments on commit 52c4c7b

Please sign in to comment.