aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Eugene Brevdo <ebrevdo@google.com>2016-12-08 14:25:47 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-12-08 14:42:39 -0800
commit056c0877adbc6ce21842f0bcdc6bb62e18f15a03 (patch)
treeef4bdc44d3df223259d1a5273904cd76a1ca6c2f
parent357ef621de7d788aa550ee86a4373a0b2d871287 (diff)
Final breaking change of SparseTensor.shape -> SparseTensor.dense_shape rename.
Removing shape property from SparseTensor. Change: 141484042
-rw-r--r--tensorflow/examples/learn/wide_n_deep_tutorial.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tensorflow/examples/learn/wide_n_deep_tutorial.py b/tensorflow/examples/learn/wide_n_deep_tutorial.py
index 1fe12f7b76..760b26bd52 100644
--- a/tensorflow/examples/learn/wide_n_deep_tutorial.py
+++ b/tensorflow/examples/learn/wide_n_deep_tutorial.py
@@ -151,11 +151,12 @@ def input_fn(df):
continuous_cols = {k: tf.constant(df[k].values) for k in CONTINUOUS_COLUMNS}
# Creates a dictionary mapping from each categorical feature column name (k)
# to the values of that column stored in a tf.SparseTensor.
- categorical_cols = {k: tf.SparseTensor(
- indices=[[i, 0] for i in range(df[k].size)],
- values=df[k].values,
- shape=[df[k].size, 1])
- for k in CATEGORICAL_COLUMNS}
+ categorical_cols = {
+ k: tf.SparseTensor(
+ indices=[[i, 0] for i in range(df[k].size)],
+ values=df[k].values,
+ dense_shape=[df[k].size, 1])
+ for k in CATEGORICAL_COLUMNS}
# Merges the two dictionaries into one.
feature_cols = dict(continuous_cols)
feature_cols.update(categorical_cols)