srush / raspy

An interactive exploration of Transformer programming.
https://srush.github.io/raspy
MIT License
237 stars 20 forks source link

Inconsistency between iPython notebook and blog post #5

Open changlinli opened 5 months ago

changlinli commented 5 months ago

The blog post mentions

Here is a simple example that produces a 2-layer transform. The first corresponds to computing length and the second the cumulative sum. The cumulative sum has to go into a second layer because it is applied to a transform which uses length, and so it can only be computed after the computation of length is complete.

but doesn't include the actual code that shows this (which the notebook does). Namely

x = cumsum(length - indices)
x.input([3, 2, 3, 5])

This is a bit confusing because in the code in the blog post would indicate that this should be a two layer transformer.

srush commented 5 months ago

Thanks, I think this was a formatting issue. Will take a look.