liveBook · Manning

Code compilation

As explained in Deep Learning with Python, Third Edition

The process of converting code into a compiled form for execution, used here as a performance and debugging tradeoff in TensorFlow, JAX, and PyTorch.

Code compilation converts a TensorFlow function into a compiled form to make repeated numerical work faster. The practical tradeoff is choosing when to use compilation rather than relying on ordinary function execution. section 3.3.1

Compile a dense operation

Mark a dense-layer function with @tf.function, then request compilation explicitly with jit_compile=True when applying the optimization.

How Deep Learning with Python, Third Edition covers it

How deep it goes
Demonstrates compilation through decorators but stops short of explaining compilation internals or a debugging workflow.
Examples
Uses a dense function decorated with @tf.function and @tf.function(jit_compile=True).
What it assumes
Assumes TensorFlow tensors and operations, while introducing function compilation within the basic TensorFlow API sequence.
What you can do after
Apply it via TensorFlow decorators to request compiled execution for a numerical function.
How it connects
Connects code compilation with TensorFlow functions and just-in-time compilation.

Also explained in

Compare how 7 books explain code compilation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with Python, Third Edition. The section links point to the parts of the book it draws on.