From 1553ae1e4a149be71703e2ee60173b3d1e0e8c00 Mon Sep 17 00:00:00 2001 From: tfdocsbot Date: Fri, 29 Oct 2021 07:02:13 +0000 Subject: [PATCH] Keras guides snapshot: Fri, 29 Oct 2021 07:02:13 GMT --- site/en/guide/keras/preprocessing_layers.ipynb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/site/en/guide/keras/preprocessing_layers.ipynb b/site/en/guide/keras/preprocessing_layers.ipynb index 06aa34119e8..b4289af5e3d 100644 --- a/site/en/guide/keras/preprocessing_layers.ipynb +++ b/site/en/guide/keras/preprocessing_layers.ipynb @@ -734,7 +734,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "fe8e1ea80f6e" + "id": "5b6c0fec928e" }, "outputs": [], "source": [ @@ -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",