lesson 1 of 4 · tensors and shapes before anything elselesson 1 of 4 · tensors and shapes before anything elselesson 1 of 4 · tensors and shapes before anything elselesson 1 of 4 · tensors and shapes before anything elselesson 1 of 4 · tensors and shapes before anything elselesson 1 of 4 · tensors and shapes before anything elselesson 1 of 4 · tensors and shapes before anything elselesson 1 of 4 · tensors and shapes before anything elselesson 1 of 4 · tensors and shapes before anything elselesson 1 of 4 · tensors and shapes before anything elselesson 1 of 4 · tensors and shapes before anything else
Checkpoint
One last thing before we move on. pass this to mark the lesson done, or skip and keep moving. hop to the next when you're ready.
Implement mean(t, dim) for a 2-D list tensor: dim=0 collapses the batch (one mean per feature, via transposing with zip(*t)), dim=1 collapses features (one mean per row); any other dim raises ValueError. Print both results in the format "dim=0: [...] -> shape (2,)" / "dim=1: [...] -> shape (3,)", then "collapsed axis differs:" with whether the output lengths differ.