Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding optional generated code printing in the demo notebook #18122

Merged
merged 1 commit into from
Mar 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@
"wait_interval": 0
},
"output_extras": [
{
"item_id": 1
}
{}
],
"base_uri": "https://localhost:8080/",
"height": 413
Expand All @@ -191,7 +189,7 @@
"source": [
"print(autograph.to_code(g))"
],
"execution_count": 4,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -243,9 +241,7 @@
"wait_interval": 0
},
"output_extras": [
{
"item_id": 1
}
{}
],
"base_uri": "https://localhost:8080/",
"height": 53
Expand Down Expand Up @@ -277,7 +273,7 @@
" print('g(9) = %s' % g(9))\n",
" print('tf_g(9) = %s' % tf_g_result)"
],
"execution_count": 5,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -323,9 +319,7 @@
"wait_interval": 0
},
"output_extras": [
{
"item_id": 1
}
{}
],
"base_uri": "https://localhost:8080/",
"height": 35
Expand Down Expand Up @@ -360,9 +354,12 @@
" with tf.Session() as sess:\n",
" result = sess.run(tf_sum_even(tf.constant([10, 12, 15, 20])))\n",
"\n",
" print('Sum of even numbers: %s' % result)"
" print('Sum of even numbers: %s' % result)\n",
" \n",
"# Uncomment the line below to print the generated graph code\n",
"# print(autograph.to_code(sum_even))"
],
"execution_count": 6,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -413,9 +410,7 @@
"wait_interval": 0
},
"output_extras": [
{
"item_id": 1
}
{}
],
"base_uri": "https://localhost:8080/",
"height": 53
Expand Down Expand Up @@ -445,9 +440,12 @@
" try:\n",
" print(sess.run(tf_f(tf.constant(0))))\n",
" except tf.errors.InvalidArgumentError as e:\n",
" print('Got error message: %s' % e.message)"
" print('Got error message: %s' % e.message)\n",
" \n",
"# Uncomment the line below to print the generated graph code\n",
"# print(autograph.to_code(f))"
],
"execution_count": 7,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -479,9 +477,7 @@
"wait_interval": 0
},
"output_extras": [
{
"item_id": 1
}
{}
],
"base_uri": "https://localhost:8080/",
"height": 35
Expand Down Expand Up @@ -512,9 +508,12 @@
"tf_print_sign = autograph.to_graph(print_sign)\n",
"with tf.Graph().as_default():\n",
" with tf.Session() as sess:\n",
" sess.run(tf_print_sign(tf.constant(1)))"
" sess.run(tf_print_sign(tf.constant(1)))\n",
" \n",
"# Uncomment the line below to print the generated graph code\n",
"# print(autograph.to_code(print_sign))"
],
"execution_count": 8,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -545,9 +544,7 @@
"wait_interval": 0
},
"output_extras": [
{
"item_id": 1
}
{}
],
"base_uri": "https://localhost:8080/",
"height": 35
Expand Down Expand Up @@ -579,9 +576,12 @@
"tf_f = autograph.to_graph(f)\n",
"with tf.Graph().as_default():\n",
" with tf.Session() as sess:\n",
" print(sess.run(tf_f(tf.constant(5))))"
" print(sess.run(tf_f(tf.constant(5))))\n",
" \n",
"# Uncomment the line below to print the generated graph code\n",
"# print(autograph.to_code(f))"
],
"execution_count": 9,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -612,9 +612,7 @@
"wait_interval": 0
},
"output_extras": [
{
"item_id": 1
}
{}
],
"base_uri": "https://localhost:8080/",
"height": 53
Expand Down Expand Up @@ -661,9 +659,12 @@
"with tf.Graph().as_default(): \n",
" with tf.Session() as sess:\n",
" n = tf.constant(50)\n",
" sess.run(tf_print_primes(n))"
" sess.run(tf_print_primes(n))\n",
" \n",
"# Uncomment the line below to print the generated graph code\n",
"# print(autograph.to_code(print_primes))"
],
"execution_count": 10,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -978,15 +979,9 @@
"wait_interval": 0
},
"output_extras": [
{
"item_id": 13
},
{
"item_id": 14
},
{
"item_id": 15
}
{},
{},
{}
],
"base_uri": "https://localhost:8080/",
"height": 988
Expand Down Expand Up @@ -1037,7 +1032,7 @@
" plt.ylabel('Accuracy')\n",
" plt.show()"
],
"execution_count": 17,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -1419,75 +1414,29 @@
"wait_interval": 0
},
"output_extras": [
{
"item_id": 12
},
{
"item_id": 13
},
{
"item_id": 14
},
{
"item_id": 15
},
{
"item_id": 16
},
{
"item_id": 17
},
{
"item_id": 18
},
{
"item_id": 19
},
{
"item_id": 20
},
{
"item_id": 21
},
{
"item_id": 23
},
{
"item_id": 24
},
{
"item_id": 25
},
{
"item_id": 26
},
{
"item_id": 27
},
{
"item_id": 28
},
{
"item_id": 29
},
{
"item_id": 30
},
{
"item_id": 31
},
{
"item_id": 32
},
{
"item_id": 33
},
{
"item_id": 34
},
{
"item_id": 35
}
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{}
],
"base_uri": "https://localhost:8080/",
"height": 668
Expand Down Expand Up @@ -1553,7 +1502,7 @@
" # Run the inference loop.\n",
" run_input_loop(sess, inference_ops, color_name_placeholder)"
],
"execution_count": 22,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -1967,4 +1916,4 @@
]
}
]
}
}