LESSON 6.02 · 6 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW
Broadcasting
Watch two tensors of different shapes line up, stretch and combine.
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 2 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 6.02 · BROADCAST BAYA (3, 1) · B (4,)
01
Stage 1 of 6 · Two tensors
A has shape (3, 1) and B has shape (4,). Broadcasting lets one operation join them.
Explain it simply
You see two small grids of numbers. A, the first grid, holds tens, and B, the second, holds ones. Their shapes are different, so the cells do not pair up yet. Broadcasting is the rule PyTorch uses to fit different shapes together.
Grid A has shape (3, 1). Grid B has shape (4,). The shape table above lists each size.
stored valuesstretched view, not copiedstridesresultshape error
Toy: A of tens, (3, 1) or (3, 4); B of ones
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Each tensor has a shape: its size along each dim.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 more stages and 2 live controls
- 2 mix-up cards and 3 predict-then-reveal checks
- Watch it as a narrated video, in three voices
- Every Pro lesson and capstone · 656 in total
$99 a year, or $15 a month. Cancel any time.