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.

  1. Which metric should you use when testing a TensorFlow model on a highly imbalanced binary classification dataset? β†’ F1-Score or AUC-ROC
  2. Which technique trains a model in multiple steps with increasing dataset sizes? β†’ Curriculum learning
  3. What is the purpose of tf.keras.callbacks.CSVLogger during model evaluation training runs? β†’ Appends epoch-level metrics to a CSV file for later analysis
  4. What must be true about a model before calling model.load_weights() successfully? β†’ Its layer shapes must match those of the saved weights
  5. In TensorFlow, tf.keras.metrics.SparseCategoricalAccuracy is preferred over CategoricalAccuracy when: β†’ Labels are integer class indices rather than one-hot vectors
  6. What does dataset.repeat(3) do in tf.data? β†’ Iterates through the dataset 3 times
  7. Batch normalization is useful due to? β†’ It normalizes (adjustments) all the input earlier than sending it to the subsequent layer
  8. In model.evaluate(), the steps parameter controls what? β†’ Number of batches to draw from the dataset
  9. What is mixed precision training in TensorFlow? β†’ Using float16 for computations and float32 for weights to speed up training
  10. What does the num_parallel_calls parameter in dataset.map() do? β†’ Parallelizes the map transformation across multiple CPU threads
  11. What is the purpose of tf.data.Dataset.batch() when preparing test data? β†’ Groups samples into mini-batches for efficient evaluation
  12. What is the primary role of tf.train.CheckpointManager? β†’ Limiting the number of checkpoints kept with max_to_keep
  13. Which TensorFlow constant creates a 3Γ—3 identity matrix? β†’ tf.eye(3)
  14. What is the purpose of tf.debugging.assert_shapes()? β†’ Verifies tensor shapes match expectations and raises an error if not
  15. Which of the following functions should not be used to classify an image at the output layer? β†’ ReLU
  16. What is the purpose of the ModelCheckpoint callback? β†’ Saves the model at specified intervals or when performance improves
  17. Which function creates a tf.data.Dataset from a list of NumPy arrays? β†’ tf.data.Dataset.from_tensor_slices()
  18. Which attribute gives you the number of elements in a TensorFlow tensor? β†’ tf.size()
  19. What does model.evaluate() return when a model is compiled with multiple metrics? β†’ A list where the first element is loss followed by each metric value
  20. Which TensorFlow Model Analysis (TFMA) concept allows you to evaluate metrics on slices of data? β†’ SlicingSpec
  21. What is the purpose of a representative dataset in TFLite quantization? β†’ Calibrates quantization scales for activations to minimize accuracy loss
  22. Which TensorFlow function creates a tensor filled with zeros? β†’ tf.zeros()
  23. Which low-level TensorFlow function explicitly saves a model in SavedModel format? β†’ tf.saved_model.save()
  24. What does the drop_remainder=True argument do in dataset.batch()? β†’ Drops the last batch if it has fewer elements than the batch size
  25. Which Keras API allows building models with multiple inputs and outputs? β†’ Functional API
  26. Which Keras layer performs 2D convolution for image processing? β†’ Conv2D
  27. Which optimizer is recommended for training transformer-based models? β†’ Adam with warmup learning rate schedule
  28. What type of object does tf.saved_model.load() return? β†’ A trackable object containing the model's saved functions and variables
  29. A ______ is a network that includes feedback linkages from o/p to i/p as well as hidden layers. β†’ Recurrent neural network
  30. Which operation performs element-wise multiplication in TensorFlow? β†’ tf.multiply()
Was this helpful?