Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff482a0

Browse files
committed
Add note about eager. Add web button.
1 parent 3738025 commit ff482a0

File tree

1 file changed

+51
-11
lines changed

1 file changed

+51
-11
lines changed

samples/core/guide/autograph.ipynb

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
},
4646
"cell_type": "code",
4747
"source": [
48-
"#@title Licensed under the Apache License, Version 2.0 (the \"License\");\n",
48+
"#@title Licensed under the Apache License, Version 2.0 (the \"License\"); { display-mode: \"form\" }\n",
4949
"# you may not use this file except in compliance with the License.\n",
5050
"# You may obtain a copy of the License at\n",
5151
"#\n",
@@ -60,20 +60,34 @@
6060
"execution_count": 0,
6161
"outputs": []
6262
},
63+
{
64+
"metadata": {
65+
"id": "8Byow2J6LaPl",
66+
"colab_type": "text"
67+
},
68+
"cell_type": "markdown",
69+
"source": [
70+
"# AutoGraph: Easy control flow for graphs "
71+
]
72+
},
6373
{
6474
"metadata": {
6575
"id": "kGXS3UWBBNoc",
6676
"colab_type": "text"
6777
},
6878
"cell_type": "markdown",
6979
"source": [
70-
"# AutoGraph: Easy control flow for graphs \n",
71-
"\n",
72-
"<table class=\"tfo-notebook-buttons\" align=\"left\"><td>\n",
73-
"<a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/models/blob/master/samples/core/guide/autograph.ipynb\">\n",
74-
" <img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a> \n",
75-
"</td><td>\n",
76-
"<a target=\"_blank\" href=\"https://github.com/tensorflow/models/blob/master/samples/core/guide/autograph.ipynb\"><img width=32px src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a></td></table>"
80+
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
81+
" <td>\n",
82+
" <a target=\"_blank\" href=\"https://www.tensorflow.org/guide/autograph\"><img src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" />View on TensorFlow.org</a>\n",
83+
" </td>\n",
84+
" <td>\n",
85+
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/models/blob/master/samples/core/guide/autograph.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
86+
" </td>\n",
87+
" <td>\n",
88+
" <a target=\"_blank\" href=\"https://github.com/tensorflow/models/blob/master/samples/core/guide/autograph.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
89+
" </td>\n",
90+
"</table>"
7791
]
7892
},
7993
{
@@ -123,7 +137,7 @@
123137
},
124138
"cell_type": "markdown",
125139
"source": [
126-
"Import TensorFlow and AutoGraph, any supporting modules, and enable [eager execution](https://www.tensorflow.org/guide/eager):"
140+
"Import TensorFlow, AutoGraph, and any supporting modules:"
127141
]
128142
},
129143
{
@@ -144,8 +158,34 @@
144158
"import tensorflow as tf\n",
145159
"from tensorflow.contrib import autograph\n",
146160
"\n",
147-
"import matplotlib.pyplot as plt\n",
148-
"\n",
161+
"import matplotlib.pyplot as plt"
162+
],
163+
"execution_count": 0,
164+
"outputs": []
165+
},
166+
{
167+
"metadata": {
168+
"id": "Hh1PajmUJMNp",
169+
"colab_type": "text"
170+
},
171+
"cell_type": "markdown",
172+
"source": [
173+
"We'll enable [eager execution](https://www.tensorflow.org/guide/eager) for demonstration purposes, but AutoGraph works in both eager and [graph execution](https://www.tensorflow.org/guide/graphs) environments:"
174+
]
175+
},
176+
{
177+
"metadata": {
178+
"id": "ks_hiqcSJNvg",
179+
"colab_type": "code",
180+
"colab": {
181+
"autoexec": {
182+
"startup": false,
183+
"wait_interval": 0
184+
}
185+
}
186+
},
187+
"cell_type": "code",
188+
"source": [
149189
"tf.enable_eager_execution()"
150190
],
151191
"execution_count": 0,

0 commit comments

Comments
 (0)