TensorFlow
TensorFlow covers the same ground as PyTorch with different defaults: tf.function graphs, tf.data input pipelines, Keras as the model API, tf.distribute for scale, and SavedModel plus TF Serving for deployment. Common wherever a production stack was built a few years ago.
on this pageshowhide
explore
- Tensors and Graphs6 questions
- tf.data Pipelines6 questions
- Keras API4 questions
- Training and Optimization7 questions
- Distributed Training6 questions
- SavedModel and Serving6 questions
questions
page 2 of 2In tf.distribute, how do you choose between MirroredStrategy, MultiWorkerMirroredStrategy, and ParameterServerStrategy?
basics
~20 sMatch the hardware and the failure model: MirroredStrategy for several GPUs in one box, MultiWorkerMirroredStrategy for several machines with a good interconnect, ParameterServerStrategy when workers are asynchronous or preemptible. All three replicate the model, so none of them fits a model too large for one device.
Should a TF 2.15 codebase set TF_USE_LEGACY_KERAS or migrate to Keras 3?
basics
~20 sDecide by blast radius. TF_USE_LEGACY_KERAS=1 with the tf_keras package unblocks the TensorFlow upgrade in a day but pins you to a maintenance-only Keras 2. Treat it as a time-boxed bridge and schedule the Keras 3 migration behind it.
When would you serve a SavedModel with TF Serving instead of a custom Python service?
basics
~20 sTF Serving is worth it when the endpoint is mostly tensor math and you want versioning, request batching, warmup and a C++ runtime for free. A custom service wins when heavy Python-side logic surrounds the model and cannot move into the graph.
When is eager execution the right default in a TensorFlow codebase?
basics
~20 sEager suits development, debugging, and code dominated by a few large ops or by dynamic Python, where graph optimization buys little. Graph execution earns its constraints where many small ops run in a hot loop, where XLA or an exported artifact is required, or where a Python interpreter cannot be in the path.
When is a custom TensorFlow training loop worth its cost over the built-in fit loop?
basics
~20 sOnly when the step itself is genuinely non-standard — alternating optimizers, gradient surgery, higher-order gradients. A hand-written loop is not faster; it makes you re-own metric aggregation, validation, checkpoint cadence and logging, and every one of those is a place to introduce a silent bug.
showing 31–35 of 35