EasyDeepLearn

In one sentence, what is broadcasting and why does it matter?

easy

Answer

  • 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