Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
de284240
Unverified
Commit
de284240
authored
Jul 16, 2018
by
Mark Daoust
Committed by
GitHub
Jul 16, 2018
Browse files
Merge pull request #4789 from MarkDaoust/autopgraph-guide
Autograph guide
parents
3ec66da0
89609809
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
samples/core/guide/autograph.ipynb
samples/core/guide/autograph.ipynb
+5
-5
No files found.
samples/core/guide/autograph.ipynb
View file @
de284240
...
@@ -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",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment