|
45 | 45 | },
|
46 | 46 | "cell_type": "code",
|
47 | 47 | "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", |
49 | 49 | "# you may not use this file except in compliance with the License.\n",
|
50 | 50 | "# You may obtain a copy of the License at\n",
|
51 | 51 | "#\n",
|
|
60 | 60 | "execution_count": 0,
|
61 | 61 | "outputs": []
|
62 | 62 | },
|
| 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 | + }, |
63 | 73 | {
|
64 | 74 | "metadata": {
|
65 | 75 | "id": "kGXS3UWBBNoc",
|
66 | 76 | "colab_type": "text"
|
67 | 77 | },
|
68 | 78 | "cell_type": "markdown",
|
69 | 79 | "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>" |
77 | 91 | ]
|
78 | 92 | },
|
79 | 93 | {
|
|
123 | 137 | },
|
124 | 138 | "cell_type": "markdown",
|
125 | 139 | "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:" |
127 | 141 | ]
|
128 | 142 | },
|
129 | 143 | {
|
|
144 | 158 | "import tensorflow as tf\n",
|
145 | 159 | "from tensorflow.contrib import autograph\n",
|
146 | 160 | "\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": [ |
149 | 189 | "tf.enable_eager_execution()"
|
150 | 190 | ],
|
151 | 191 | "execution_count": 0,
|
|
0 commit comments