Eager evaluation
Eager evaluation is an evaluation strategy in which expressions are computed as they are encountered rather than deferred until their values are needed.
Deep Learning with R, Third Edition
Eager execution is an execution mode in which operations run immediately and produce results without first constructing a deferred computation graph.
- How it is used
- Runs TensorFlow, PyTorch, and JAX operations immediately to support interactive development and straightforward debugging.
- How deep it goes
- Explains immediate execution, debugging benefits, and performance costs, then contrasts eager operation with compilation.
- Examples
- Uses TensorFlow tensor operations and nested gradient tapes, plus PyTorch linear models and training steps, as concrete eager examples.
- What you can do after
- Diagnose/debug tensor code interactively, then choose whether TensorFlow or PyTorch compilation is worth its performance and reliability costs.
Read how Deep Learning with R, Third Edition explains eager evaluation →
Functional Programming in Scala, Second Edition
Strict code evaluates an argument or expression before the surrounding computation proceeds, rather than delaying evaluation until its value is needed.
- How it is used
- Contrasts default strict computation with nonstrict techniques for controlling when expressions are evaluated.
- How deep it goes
- Defines strict argument evaluation and demonstrates its timing, but defers broader implementation details to nonstrictness and laziness.
- Examples
- Uses square, sys.error, conditional branches, short-circuiting operators, and LazyList construction to expose evaluation timing.
- What you can do after
- Evaluate Scala calls by predicting which arguments run before function bodies and which expressions can be skipped.
Read how Functional Programming in Scala, Second Edition explains eager evaluation →
Deep Learning with PyTorch, Second Edition
An execution model in which operations run immediately rather than being first built into a static graph.
- How it is used
- Runs PyTorch operations immediately throughout model development, training, evaluation, and deployment workflows.
- How deep it goes
- Explains execution through the Python interpreter and C++ or CUDA backends, while deferring detailed deployment capabilities to later treatment.
- Examples
- Uses PyTorch tensor instructions and a project flow spanning data loading, training, model export, and deployment.
- What you can do after
- Apply it via PyTorch by reasoning about each tensor operation as it executes and by relating computation to deployment choices.
Read how Deep Learning with PyTorch, Second Edition explains eager evaluation →
Functional Programming in JavaScript
- How it is used
- Explains why JavaScript may perform unnecessary work before a dependent operation can limit the result.
- How deep it goes
- Defines immediate expression evaluation and contrasts it with deferred execution, without detailing language-runtime internals.
- Examples
- Uses range with take, a Maybe fallback, conditional control flow, and a Lodash map-filter-take chain.
- What you can do after
- Apply conditional control flow or Lodash shortcut fusion to avoid unnecessary function calls and large intermediate results.
Read how Functional Programming in JavaScript explains eager evaluation →
Fast Python: High performance techniques for large datasets
- How it is used
- Contrasts immediate computation with deferred execution when discussing data-frame processing and Python performance.
- How deep it goes
- Explains execution timing and memory trade-offs through examples, without detailing execution internals.
- Examples
- Compares range with list(range), temperature generators with lists, and deferred Dask computation with compute().
- What you can do after
- Evaluate whether to materialize results by weighing repeated access against memory use and unnecessary computation.
Read how Fast Python: High performance techniques for large datasets explains eager evaluation →
Also covered in
- API Design Patterns
- GPU Programming with TritonIn early access (MEAP)
- Write Powerful Rust Macros
- Deep Learning with Python, Third Edition
- Latency
- Rust in Action: Systems programming concepts and techniques
What to know first
- performancePerformance is a measure of how effectively a person, process, model, or system achieves its objectives, including qualities such as output quality, speed, and resource efficiency.
- filteringFiltering is the selection or exclusion of data or items according to specified criteria.
- functionA function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- logical ORLogical OR is a Boolean disjunction that is true when at least one of its component propositions is true.
Related concepts
- lazy evaluationcontrasts with · Lazy evaluation is an evaluation strategy that defers computing an expression until its value is needed, potentially avoiding the computation entirely.
- transformersused by · Hugging Face Transformers is an open-source software library for loading, using, and training pretrained transformer models across machine-learning tasks.
- PyTorchused by · PyTorch is an open-source machine-learning framework that provides tensor computation, automatic differentiation, and tools for developing and training neural networks.
- applicative applyused by · Applicative apply is an operation that applies a function in an applicative context to a value in a compatible applicative context, combining their effects.
- schedulingused by · Scheduling is the assignment and ordering of tasks or activities over time and available resources, subject to constraints.
Questions about eager evaluation
What is eager evaluation?
Eager evaluation is an evaluation strategy in which expressions are computed as they are encountered rather than deferred until their values are needed.
Which Manning books explain eager evaluation?
Deep Learning with R, Third Edition, Functional Programming in Scala, Second Edition, Deep Learning with PyTorch, Second Edition, Functional Programming in JavaScript and Fast Python: High performance techniques for large datasets.
What should I know before learning eager evaluation?
Manning books that teach eager evaluation usually introduce performance, filtering, function and logical OR first.
What is the difference between eager evaluation and lazy evaluation?
Eager evaluation is an evaluation strategy in which expressions are computed as they are encountered rather than deferred until their values are needed. Lazy evaluation is an evaluation strategy that defers computing an expression until its value is needed, potentially avoiding the computation entirely.
What is eager evaluation also called?
Eager evaluation is also called eager execution, strict evaluation or eager mode.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.




