Running and Verification
Procedure
- Use PuTTY to log in to the server as the root user.
- Create a test file, test.py.
- Create test.py.
vim test.py
- Press i to enter the insert mode and add the following content to the file:
import theano from theano import tensor ##declare two symbolic floating-point scalars a = tensor.dscalar() b = tensor.dscalar() ##create a simple expression c = a + b ##convert the expression into a callable object that takes (a,b) ##values as input and computes a value for c f = theano.function([a,b], c) ##bind 1.5 to 'a', 2.5 to 'b', and evaluate 'c' assert 4.0 == f(1.5, 2.5)
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Create test.py.
- Perform a test.
python3 test.py
No command output is displayed, indicating that the conclusion "1.5 + 2.5 = 4.0" is true.
- Create a test file, test2.py.
- Create test2.py.
vim test2.py
- Press i to enter the insert mode and add the following content to the file:
import theano from theano import tensor ##declare two symbolic floating-point scalars a = tensor.dscalar() b = tensor.dscalar() ##create a simple expression c = a + b ##convert the expression into a callable object that takes (a,b) ##values as input and computes a value for c f = theano.function([a,b], c) ##bind 1.5 to 'a', 2.5 to 'b', and evaluate 'c' assert 4.5== f(1.5, 2.5)
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Create test2.py.
- Perform a test again.
python3 test2.py
An error is reported, indicating that the conclusion "1.5 + 2.5 = 4.5" is incorrect.

Parent topic: Theano 1.0.5 Porting Guide (Kylin V10)