The missing manual for TensorFlow 2’s sharp edges
A tutorial series that teaches TensorFlow 2 by dissecting its footguns: broadcasting traps, operator performance cliffs, and the imperative-versus-symbolic divide.

What it does
EffectiveTensorflow is an open-source tutorial series—styled as an ebook—that walks through TensorFlow 2 fundamentals with an emphasis on practical patterns and pitfalls. It explains how TF2 redesigned its API to feel like NumPy while keeping the symbolic machinery needed for autodiff and GPU/TPU execution. The guide covers broadcasting semantics, control flow, numerical stability, and how to move between eager execution and graph mode with tf.function.
The interesting bit
Rather than rehashing API docs, it adopts an “Effective C++” mindset: showing how innocent Python habits become expensive in TF2. One example demonstrates that slicing a tensor in a loop takes 0.045 seconds, tf.unstack drops that to 0.01 seconds, and tf.reduce_sum finishes in 0.0001 seconds—a 100× gap for the same result. It also highlights silent broadcasting bugs, like a rank mismatch turning an expected sum of 6 into 12.
Key highlights
- Explains TF2’s split personality: imperative, NumPy-like operations by default, with graph compilation and autodiff still available via
tf.function - Broadcasting deep-dive: using implicit tiling for memory-efficient feature merging, plus warnings about rank-mismatch surprises
- Performance reality checks: compares Python slicing,
tf.unstack, and vectorized reductions on the same task - Maps Python overloaded operators (
+,@,**, etc.) to their TensorFlow counterparts, noting gaps like missing==and logical keyword support - Evolved from a TF 1.x guide; authors note they are gradually expanding the TF 2.x content
Caveats
- Only Part I is visible in the table of contents, and the authors describe the series as a gradual work in progress
- Some references still point to the TF 2.0 alpha release, so a few details may feel dated
- The provided source is truncated, leaving the full scope of later sections unclear
Verdict
Worth bookmarking if you are migrating from TF 1.x or NumPy and want to skip the trial-and-error phase of TF2 footguns. Skip it if you are looking for an installable library or a quick-reference cheat sheet.
Frequently asked
- What is vahidk/EffectiveTensorflow?
- A tutorial series that teaches TensorFlow 2 by dissecting its footguns: broadcasting traps, operator performance cliffs, and the imperative-versus-symbolic divide.
- Is EffectiveTensorflow open source?
- Yes — vahidk/EffectiveTensorflow is an open-source project tracked on heatdrop.
- How popular is EffectiveTensorflow?
- vahidk/EffectiveTensorflow has 8.6k stars on GitHub.
- Where can I find EffectiveTensorflow?
- vahidk/EffectiveTensorflow is on GitHub at https://github.com/vahidk/EffectiveTensorflow.