Computation graph
A computation graph is a directed graph whose nodes represent computational operations or values and whose edges represent dependencies between them.
Fast Python: High performance techniques for large datasets
- How it is used
- Uses task graphs as lazy execution plans for partitioned data-frame and array computations.
- How deep it goes
- Explains graph construction, visualization, partitioning, persistence, and scheduling, then examines communication bottlenecks and task granularity.
- Examples
- Uses tax CSV transformations, a distributed maximum and sort, and blockwise Mandelbrot array initialization.
- What you can do after
- Diagnose potential bottlenecks with Dask graph visualizations and choose partitioning or persistence strategies.
Read how Fast Python: High performance techniques for large datasets explains computation graph →
Build AI Drug Discovery Pipelines
A computational graph is a directed graph whose nodes represent computational operations or values and whose edges represent their dependencies.
- How it is used
- Explains how PyTorch represents learning computations and obtains gradients for training neural networks.
- How deep it goes
- Defines graph structure and demonstrates logistic-regression forward and backward passes, while deferring deeper automatic-differentiation internals.
- Examples
- Uses logistic regression, a PyTorch gradient listing, neural-network diagrams, and EGFR activity prediction from Morgan fingerprints.
- What you can do after
- Apply PyTorch computational graphs to inspect predictions, losses, and parameter gradients during model training.
Read how Build AI Drug Discovery Pipelines explains computation graph →
Deep Learning with R, Third Edition
A computation graph is a directed representation of operations and their data dependencies used to evaluate computations and derivatives.
- How it is used
- Uses computation graphs to record tensor operations and support automatic differentiation in neural network training.
- How deep it goes
- Explains forward and backward passes through a scalar graph, then uses framework differentiation instead of implementing backpropagation from scratch.
- Examples
- Illustrates a scalar linear expression, a neural network training step, and a squared tensor whose gradients accumulate.
- What you can do after
- Apply it via TensorFlow GradientTape or PyTorch backward() to obtain gradients, and reset accumulated PyTorch gradients when needed.
Read how Deep Learning with R, Third Edition explains computation graph →
Deep Learning with Python, Third Edition
A directed acyclic graph that represents a computation as operations and intermediate values, enabling automatic differentiation.
- How it is used
- Uses computation graphs to explain automatic differentiation and backpropagation in neural networks.
- How deep it goes
- Defines directed acyclic operation graphs and explains derivative chaining, then demonstrates PyTorch’s backward interface.
- Examples
- Uses composed functions, a two-layer model, and a PyTorch squared-tensor gradient to illustrate graphs.
- What you can do after
- Apply it via PyTorch to compute and reset gradients with backward() and .grad.
Read how Deep Learning with Python, Third Edition explains computation graph →
Deep Learning with PyTorch, Second Edition
A graph representation captured from model execution that records operations and data flow.
- How it is used
- Uses computation graphs for automatic differentiation during training and for representing models for deployment.
- How deep it goes
- Explains reverse graph traversal and gradient accumulation, then shows an exported graph’s operations and data flow.
- Examples
- Uses a linear model with squared-error loss and an exported graph containing linear and ReLU operations.
- What you can do after
- Apply it via PyTorch autograd and torch.export to compute gradients and inspect an exported model graph.
Read how Deep Learning with PyTorch, Second Edition explains computation graph →
Build a Reasoning Model (From Scratch)
A recorded graph of differentiable operations in PyTorch that enables gradient computation during backpropagation.
- How it is used
- Supports policy optimization by preserving the path from rollout log probabilities to model parameters for a later backward pass.
- How deep it goes
- Defines operation recording and gradient propagation, then stops short of requiring a detailed graph tutorial.
- Examples
- Uses sequence-level log-probability code, SumBackward0 output, and rollout scoring to expose graph participation.
- What you can do after
- Apply it via PyTorch by retaining gradients through sequence scores for policy-training updates.
Read how Build a Reasoning Model (From Scratch) explains computation graph →
Machine Learning Algorithms in Depth
A graph representation in which nodes and edges describe the composition and flow of computations.
- How it is used
- Frames deep learning as stacked computational layers organized for sequential and parallel processing.
- How deep it goes
- Defines depth and breadth and links graphs to backpropagation, but defers detailed treatment of individual computational blocks.
- Examples
- Uses a deep neural network architecture for sentiment analysis as its concrete graph example.
- What you can do after
- Evaluate how deep-learning layers support sequential computation, parallel computation, and parameter refinement.
Read how Machine Learning Algorithms in Depth explains computation graph →
Learn Generative AI with PyTorch
A directed graph of mathematical operations and data flow used to compute gradients in deep learning.
- How it is used
- Supports efficient mathematical computation, backpropagation, and gradient-based training in deep-learning models.
- How deep it goes
- Defines nodes, edges, data flow, and gradient use, but stops short of a worked derivation or implementation walkthrough.
- Examples
- Uses PyTorch's dynamically created graph and its GPU-versus-CPU training context as practical examples.
- What you can do after
- Evaluate how PyTorch represents operations and computes gradients during model training.
Read how Learn Generative AI with PyTorch explains computation graph →
Also covered in
What to know first
- backpropagationBackpropagation is reverse-mode differentiation that propagates derivatives backward through a computational graph to compute gradients of an output or loss with respect to inputs and parameters.
- gradientA gradient is the vector of partial derivatives of a scalar function with respect to its variables, indicating its local rate and direction of change.
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- PythonPython is a high-level, general-purpose, dynamically typed programming language with readable syntax and support for multiple programming paradigms.
Related concepts
- ONNXused by · ONNX (Open Neural Network Exchange) is an open standard and format for representing and exchanging machine-learning models across frameworks, tools, and runtimes.
- backpropagationused by · Backpropagation is reverse-mode differentiation that propagates derivatives backward through a computational graph to compute gradients of an output or loss with respect to inputs and parameters.
- Daskproduced by · Dask is an open-source Python library for parallel and distributed computing using task graphs and scalable data structures for large or partitioned workloads.
- directed acyclic graphkind of · A directed acyclic graph is a graph whose edges have directions and contain no directed cycles.
- directed graphkind of · A directed graph is a graph whose edges connect vertices through ordered, oriented relationships from source to destination.
- language modelincludes · A language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
Questions about computation graph
What is computation graph?
A computation graph is a directed graph whose nodes represent computational operations or values and whose edges represent dependencies between them.
Which Manning books explain computation graph?
Fast Python: High performance techniques for large datasets, Build AI Drug Discovery Pipelines, Deep Learning with R, Third Edition, Deep Learning with Python, Third Edition, Deep Learning with PyTorch, Second Edition, Build a Reasoning Model (From Scratch), Machine Learning Algorithms in Depth and Learn Generative AI with PyTorch.
What should I know before learning computation graph?
Manning books that teach computation graph usually introduce backpropagation, gradient, language model and Python first.
What kinds of computation graph are there?
Kinds of computation graph include language model.
What is computation graph a kind of?
Computation graph is a kind of directed acyclic graph. A directed acyclic graph is a graph whose edges have directions and contain no directed cycles.
What is computation graph also called?
Computation graph is also called computational graph.
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.







