aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/examples/udacity
diff options
context:
space:
mode:
authorGravatar Andrew Harp <andrewharp@google.com>2016-12-08 20:05:49 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-12-08 20:21:45 -0800
commit1cb96893a64f59b7265f9def9968f7bed1e57662 (patch)
tree0e6d595a0806028f5f92e64c84342ae9659ca108 /tensorflow/examples/udacity
parent90b72f4b2f07a0126efb110d8d4cc96386fcc968 (diff)
Merge changes from github.
Additionally: - change single quotes to double quotes to make path rewriting easier - guard windows lib reference with PLATFORM_WINDOWS - fixed failing kmeans test Change: 141515942
Diffstat (limited to 'tensorflow/examples/udacity')
-rw-r--r--tensorflow/examples/udacity/6_lstm.ipynb8
1 files changed, 4 insertions, 4 deletions
diff --git a/tensorflow/examples/udacity/6_lstm.ipynb b/tensorflow/examples/udacity/6_lstm.ipynb
index 159182c3fa..64e913acf8 100644
--- a/tensorflow/examples/udacity/6_lstm.ipynb
+++ b/tensorflow/examples/udacity/6_lstm.ipynb
@@ -167,10 +167,10 @@
},
"source": [
"def read_data(filename):\n",
- " f = zipfile.ZipFile(filename)\n",
- " for name in f.namelist():\n",
- " return tf.compat.as_str(f.read(name))\n",
- " f.close()\n",
+ " with zipfile.ZipFile(filename) as f:\n",
+ " name = f.namelist()[0]\n",
+ " data = tf.compat.as_str(f.read(name))\n",
+ " return data\n",
" \n",
"text = read_data(filename)\n",
"print('Data size %d' % len(text))"