"data/vscode:/vscode.git/clone" did not exist on "08c8adb6e8e03b1f088a53a70981dc9ddd71fa4b"
Unverified Commit de284240 authored by Mark Daoust's avatar Mark Daoust Committed by GitHub
Browse files

Merge pull request #4789 from MarkDaoust/autopgraph-guide

Autograph guide
parents 3ec66da0 89609809
...@@ -488,7 +488,7 @@ ...@@ -488,7 +488,7 @@
"def f(n):\n", "def f(n):\n",
" z = []\n", " z = []\n",
" # We ask you to tell us the element dtype of the list\n", " # We ask you to tell us the element dtype of the list\n",
" autograph.utils.set_element_type(z, tf.int32)\n", " autograph.set_element_type(z, tf.int32)\n",
" \n", " \n",
" for i in range(n):\n", " for i in range(n):\n",
" z.append(i)\n", " z.append(i)\n",
...@@ -746,13 +746,13 @@ ...@@ -746,13 +746,13 @@
" # to convert these lists into their graph equivalent,\n", " # to convert these lists into their graph equivalent,\n",
" # we need to specify the element type of the lists.\n", " # we need to specify the element type of the lists.\n",
" train_losses = []\n", " train_losses = []\n",
" autograph.utils.set_element_type(train_losses, tf.float32)\n", " autograph.set_element_type(train_losses, tf.float32)\n",
" test_losses = []\n", " test_losses = []\n",
" autograph.utils.set_element_type(test_losses, tf.float32)\n", " autograph.set_element_type(test_losses, tf.float32)\n",
" train_accuracies = []\n", " train_accuracies = []\n",
" autograph.utils.set_element_type(train_accuracies, tf.float32)\n", " autograph.set_element_type(train_accuracies, tf.float32)\n",
" test_accuracies = []\n", " test_accuracies = []\n",
" autograph.utils.set_element_type(test_accuracies, tf.float32)\n", " autograph.set_element_type(test_accuracies, tf.float32)\n",
" \n", " \n",
" # This entire training loop will be run in-graph.\n", " # This entire training loop will be run in-graph.\n",
" i = tf.constant(0)\n", " i = tf.constant(0)\n",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment