blob: 815e6febe29a62dd33aaf4a6569cd257dab41040 [file] [log] [blame]
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import theano\n",
"from theano import tensor\n",
"# declare two symbolic floating-point scalars\n",
"a = tensor.dscalar()\n",
"b = tensor.dscalar()\n",
"# create a simple expression\n",
"c = a + b\n",
"# convert the expression into a callable object that takes (a,b)\n",
"# values as input and computes a value for c\n",
"f = theano.function([a,b], c)\n",
"# bind 1.5 to 'a', 2.5 to 'b', and evaluate 'c'\n",
"assert 4.0 == f(1.5, 2.5)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "KERNEL_NAME"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.13"
}
},
"nbformat": 4,
"nbformat_minor": 2
}