LearnTensorflow/OpenCVTensorflowDeeplearning/Chapter8/p8-1.ipynb

69 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import tensorflow as tf"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Tensor(\"Const:0\", shape=(), dtype=int32)\n",
"<tf.Variable 'Variable:0' shape=() dtype=int32_ref>\n",
"Tensor(\"Const:0\", shape=(), dtype=int32)\n",
"1\n"
]
}
],
"source": [
"input1 = tf.constant(1)\n",
"print(input1)\n",
"input2 = tf.Variable(2, tf.int32)\n",
"print(input2)\n",
"input2 = input1\n",
"print(input2)\n",
"with tf.Session() as sess:\n",
" print(sess.run(input2))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}