Skip to content
← All tracks

Reductions and dim

PyTorch

`dim` is the axis that disappears, and nearly every reduction bug is a disagreement about which one that is. Plus the reductions that are wrong before they are slow: integer means, unstable sums, ties in argmax.

0 / 7 solved
  1. 1. Not solved yet. Which axis disappeared
  2. 2. Not solved yet. Accuracy from a comparison
  3. 3. Not solved yet. Softmax from the definition
  4. 4. Not solved yet. One missing value
  5. 5. Not solved yet. Per-channel statistics
  6. 6. Not solved yet. The sum that drifts
  7. 7. Not solved yet. Running totals

Check yourself

4 questions · one attempt each

These do not count toward finishing the track. They are here to catch the things that are easy to read past.

0 / 4

x is (3, 4). What shape does each reduction give?

x.sum(dim=0)
x.sum(dim=0, keepdim=True)
Question 1 of 4