In fact, you are talking to Theano about calculating three different functions, where each subsequent function depends on the output of a previously executed function.
In your example, you use two input parameters: matrix A and matrix B.
A = [[ 1, 1 ], [ 1, 1 ]] B = [[ 0, 1 ], [ 2, 3 ]]
The first output line: [[ 1., 0.], [-1., -2.]] Is calculated by subtracting your matrices A and B:
[[1, 1], - [[0, 1], = [[ 1, 0 ], [1, 1]] [2, 3]] [-1, -2]
The second output line [[ 1., 0.], [ 1., x2.]] Is just the absolute value of the difference that we just calculated:
abs [[ 1, 0 ], = [[ 1, 0], [-1, -2]] [ 1, 2]]
The third and last line calculates quadratic values ββfor the elements.
The magic of teano
Theano actually interprets your Python code and gives out which variables (or mathematical operations) this variable depends on. Thus, if you are only interested in diff_squared output, you do not need to include calls to diff and abs_diff too.
f = function([a, b], [diff_squared])