TensorFlow Cheat Sheet 2026
The 30 highest-yield TensorFlow facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.
- Which technique trains a model in multiple steps with increasing dataset sizes? → Curriculum learning
- What must be true about a model before calling model.load_weights() successfully? → Its layer shapes must match those of the saved weights
- What does dataset.repeat(3) do in tf.data? → Iterates through the dataset 3 times
- Batch normalization is useful due to? → It normalizes (adjustments) all the input earlier than sending it to the subsequent layer
- What is mixed precision training in TensorFlow? → Using float16 for computations and float32 for weights to speed up training
- What does the num_parallel_calls parameter in dataset.map() do? → Parallelizes the map transformation across multiple CPU threads
- What is the primary role of tf.train.CheckpointManager? → Limiting the number of checkpoints kept with max_to_keep
- Which TensorFlow constant creates a 3×3 identity matrix? → tf.eye(3)
- What is the purpose of tf.debugging.assert_shapes()? → Verifies tensor shapes match expectations and raises an error if not
- Which of the following functions should not be used to classify an image at the output layer? → ReLU
- What is the purpose of the ModelCheckpoint callback? → Saves the model at specified intervals or when performance improves
- Which function creates a tf.data.Dataset from a list of NumPy arrays? → tf.data.Dataset.from_tensor_slices()
- Which attribute gives you the number of elements in a TensorFlow tensor? → tf.size()
- What is the purpose of a representative dataset in TFLite quantization? → Calibrates quantization scales for activations to minimize accuracy loss
- Which TensorFlow function creates a tensor filled with zeros? → tf.zeros()
- Which low-level TensorFlow function explicitly saves a model in SavedModel format? → tf.saved_model.save()
- What does the drop_remainder=True argument do in dataset.batch()? → Drops the last batch if it has fewer elements than the batch size
- Which Keras API allows building models with multiple inputs and outputs? → Functional API
- Which Keras layer performs 2D convolution for image processing? → Conv2D
- Which optimizer is recommended for training transformer-based models? → Adam with warmup learning rate schedule
- What type of object does tf.saved_model.load() return? → A trackable object containing the model's saved functions and variables
- A ______ is a network that includes feedback linkages from o/p to i/p as well as hidden layers. → Recurrent neural network
- Which operation performs element-wise multiplication in TensorFlow? → tf.multiply()
- Which callback stops training when a monitored metric stops improving? → EarlyStopping
- Which tf.data method interleaves elements from multiple datasets? → dataset.interleave()
- What is the difference between model.predict() and model(x) in Keras? → predict() handles large datasets in batches; model(x) runs a single forward pass eagerly
- What is the rank of a scalar tensor in TensorFlow? → 0
- What does dataset.prefetch(tf.data.AUTOTUNE) do? → Prepares the next batch while the current one is being processed
- What does tf.keras.applications provide? → Pre-built, pre-trained models like ResNet, VGG, and MobileNet for transfer learning
- Which Keras initializer sets weights to small random values drawn from a normal distribution? → GlorotNormal
Turn these facts into recall: