In one sentence, what is broadcasting and why does it matter?
easyAnswer
- Broadcasting extends tensor operations across dimensions of unequal shape by implicit repetition, with rules: align shapes from the right, dimensions of size 1 are broadcast to match, otherwise dimensions must match.
- It lets you write add, multiply, and mask operations across batches and features without explicit tile/repeat — critical for efficient GPU code.
Check yourself — multiple choice
- Broadcasting doubles memory usage
- Auto-expansion of mismatched shapes via size-1 dimension rules — efficient batched ops
- Only works in NumPy
- It's the same as reshape
Broadcasting: implicit shape expansion for batched ops — the workhorse of tensor code.
#fundamentals
Practise Deep Learning
214 interview questions in this topic.
Related questions
- ReLU vs sigmoid vs GELU — when do you use each?
- In one sentence, what is backpropagation?
- State the universal approximation theorem in one sentence and its practical caveat.
- Why does stacking linear layers without nonlinearity collapse to a single linear layer?
- Depth vs width — which do you scale first?
- Why can't you initialize a neural net with all zeros?