" <img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a> \n",
" <td>\n",
"</td><td>\n",
" <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",
"<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>"
" </td>\n",
" <td>\n",
" <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",
" </td>\n",
"</table>"
]
]
},
},
{
{
...
@@ -123,7 +137,7 @@
...
@@ -123,7 +137,7 @@
},
},
"cell_type": "markdown",
"cell_type": "markdown",
"source": [
"source": [
"Import TensorFlow and AutoGraph, any supporting modules, and enable [eager execution](https://www.tensorflow.org/guide/eager):"
"Import TensorFlow, AutoGraph, and any supporting modules:"
]
]
},
},
{
{
...
@@ -144,8 +158,34 @@
...
@@ -144,8 +158,34 @@
"import tensorflow as tf\n",
"import tensorflow as tf\n",
"from tensorflow.contrib import autograph\n",
"from tensorflow.contrib import autograph\n",
"\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib.pyplot as plt"
"\n",
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "Hh1PajmUJMNp",
"colab_type": "text"
},
"cell_type": "markdown",
"source": [
"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:"