PyTorch-only labs; this note maps the five PyTorch concepts to Keras equivalents so TF-shop interviews hold no surprises. Reading-level only.
Mapping table
| PyTorch (labs) | Keras equivalent | Note |
|---|---|---|
| Tensor + autograd | tf.Tensor + GradientTape | Tape scopes the watched ops |
nn.Module + training loop | Model.fit / custom train_step | fit hides the loop; know both |
| Conv2d/MaxPool stacks | Conv2D/MaxPooling2D | Same receptive-field math |
| Embedding + LSTM/GRU + masking | Embedding(mask_zero=True) + LSTM/GRU | Masking semantics match |
Freeze (requires_grad=False) + LR groups | layer.trainable=False + optimizers | Same discipline, new API |
Recap
Five rows memorized with the API asymmetry per row (Tape scoping, fit-vs-loop, mask_zero) — enough to whiteboard either framework.