aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/dist_test
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/tools/dist_test')
-rw-r--r--tensorflow/tools/dist_test/python/census_widendeep.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tensorflow/tools/dist_test/python/census_widendeep.py b/tensorflow/tools/dist_test/python/census_widendeep.py
index 309366e467..62ff7f8f2f 100644
--- a/tensorflow/tools/dist_test/python/census_widendeep.py
+++ b/tensorflow/tools/dist_test/python/census_widendeep.py
@@ -217,11 +217,12 @@ class CensusDataSource(object):
for k in self.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 self.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 self.categorical_columns}
# Merges the two dictionaries into one.
feature_cols = dict(continuous_cols.items() + categorical_cols.items())
# Converts the label column into a constant Tensor.