Skip to content

Commit

Permalink
Keras guides snapshot: Fri, 29 Oct 2021 07:02:13 GMT
Browse files Browse the repository at this point in the history
  • Loading branch information
tfdocsbot committed Oct 29, 2021
1 parent ca06383 commit 1553ae1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions site/en/guide/keras/preprocessing_layers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "fe8e1ea80f6e"
"id": "5b6c0fec928e"
},
"outputs": [],
"source": [
Expand All @@ -751,7 +751,10 @@
"# (multi-hot with TF-IDF weighting) and ngrams=2 (index all bigrams)\n",
"text_vectorizer = layers.TextVectorization(output_mode=\"tf-idf\", ngrams=2)\n",
"# Index the bigrams and learn the TF-IDF weights via `adapt()`\n",
"text_vectorizer.adapt(adapt_data)\n",
"\n",
"with tf.device(\"CPU\"):\n",
" # A bug that prevents this from running on GPU for now.\n",
" text_vectorizer.adapt(adapt_data)\n",
"\n",
"# Try out the layer\n",
"print(\n",
Expand Down

0 comments on commit 1553ae1

Please sign in to comment.