← Questions

MLP tensor shapes and PyTorch broadcasting

0
NvidiaML designLast asked Jan 2026

Given a small multi-layer perceptron and a batch of inputs, write down the shape of every weight, bias, activation and gradient. Then explain PyTorch's broadcasting rules, how the bias is broadcast across the batch, and the shape bugs broadcasting can hide.

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing