Core transformations of the computation graph.
Compiler
trait, which simply specifies a single function:
add(a, mul(b, -1))
. We can have a compiler that looks for that pattern of nodes and directly replaces it with a Subtract
operation. We’ll look at how to do this in the Writing Compilers section.
All you need to know for now is that we can use this compiler on the graph by doing: