From e1cb0920c8f5d1639faa692ef04c2eee65296c93 Mon Sep 17 00:00:00 2001 From: Eugene Brevdo Date: Thu, 8 Dec 2016 15:07:42 -0800 Subject: Final breaking change of SparseTensor.shape -> SparseTensor.dense_shape rename. Removing shape property from SparseTensor. Change: 141489556 --- .../dnn_linear_combined_benchmark_test.py | 2 +- .../learn/python/learn/estimators/dnn_test.py | 32 +++++++++++----------- .../learn/estimators/dynamic_rnn_estimator_test.py | 4 +-- .../learn/python/learn/estimators/linear_test.py | 4 +-- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined_benchmark_test.py b/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined_benchmark_test.py index fe996f1dee..5caf6caf0a 100644 --- a/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined_benchmark_test.py +++ b/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined_benchmark_test.py @@ -98,7 +98,7 @@ class DNNLinearCombinedClassifierBenchmark(tf.test.Benchmark): features['dummy_sparse_column'] = tf.SparseTensor( values=('en', 'fr', 'zh'), indices=((0, 0), (0, 1), (60, 0)), - shape=(len(iris.target), 2)) + dense_shape=(len(iris.target), 2)) labels = tf.reshape(tf.constant(iris.target, dtype=tf.int32), (-1, 1)) return features, labels diff --git a/tensorflow/contrib/learn/python/learn/estimators/dnn_test.py b/tensorflow/contrib/learn/python/learn/estimators/dnn_test.py index 9e1bf07245..92b5a71b3c 100644 --- a/tensorflow/contrib/learn/python/learn/estimators/dnn_test.py +++ b/tensorflow/contrib/learn/python/learn/estimators/dnn_test.py @@ -57,7 +57,7 @@ class EmbeddingMultiplierTest(tf.test.TestCase): tf.SparseTensor( values=['en', 'fr', 'zh'], indices=[[0, 0], [1, 0], [2, 0]], - shape=[3, 1]), + dense_shape=[3, 1]), } labels = tf.constant([[0], [0], [0]], dtype=tf.int32) with self.assertRaisesRegexp( @@ -87,12 +87,12 @@ class EmbeddingMultiplierTest(tf.test.TestCase): tf.SparseTensor( values=['en', 'fr', 'zh'], indices=[[0, 0], [1, 0], [2, 0]], - shape=[3, 1]), + dense_shape=[3, 1]), 'wire': tf.SparseTensor( values=['omar', 'stringer', 'marlo'], indices=[[0, 0], [1, 0], [2, 0]], - shape=[3, 1]), + dense_shape=[3, 1]), } labels = tf.constant([[0], [0], [0]], dtype=tf.int32) model_ops = dnn._dnn_model_fn(features, labels, @@ -193,7 +193,7 @@ class DNNClassifierTest(tf.test.TestCase): values=tf.train.limit_epochs( ['en', 'fr', 'zh'], num_epochs=num_epochs), indices=[[0, 0], [0, 1], [2, 0]], - shape=[3, 2]) + dense_shape=[3, 2]) } return features, tf.constant([[1], [0], [0]], dtype=tf.int32) @@ -230,7 +230,7 @@ class DNNClassifierTest(tf.test.TestCase): values=tf.train.limit_epochs( ['en', 'fr', 'zh'], num_epochs=num_epochs), indices=[[0, 0], [0, 1], [2, 0]], - shape=[3, 2]) + dense_shape=[3, 2]) } labels = tf.constant([[0.8], [0.], [0.2]], dtype=tf.float32) return features, labels @@ -415,7 +415,7 @@ class DNNClassifierTest(tf.test.TestCase): values=tf.train.limit_epochs( ['en', 'fr', 'zh'], num_epochs=num_epochs), indices=[[0, 0], [0, 1], [2, 0]], - shape=[3, 2]) + dense_shape=[3, 2]) } return features, tf.constant([[1], [0], [0]], dtype=tf.int32) @@ -453,7 +453,7 @@ class DNNClassifierTest(tf.test.TestCase): values=tf.train.limit_epochs( ['en', 'fr', 'zh'], num_epochs=num_epochs), indices=[[0, 0], [0, 1], [2, 0]], - shape=[3, 2]) + dense_shape=[3, 2]) } return features, tf.constant([[1], [0], [0]], dtype=tf.int32) @@ -552,7 +552,7 @@ class DNNClassifierTest(tf.test.TestCase): values=tf.train.limit_epochs( ['en', 'fr', 'zh'], num_epochs=num_epochs), indices=[[0, 0], [0, 1], [2, 0]], - shape=[3, 2]) + dense_shape=[3, 2]) } return features, tf.constant([[1], [0], [0]], dtype=tf.int32) @@ -594,7 +594,7 @@ class DNNClassifierTest(tf.test.TestCase): values=tf.train.limit_epochs( ['en', 'fr', 'zh'], num_epochs=num_epochs), indices=[[0, 0], [0, 1], [2, 0]], - shape=[3, 2]) + dense_shape=[3, 2]) } return features, tf.constant([[1], [0], [0]], dtype=tf.int32) @@ -760,7 +760,7 @@ class DNNRegressorTest(tf.test.TestCase): values=tf.train.limit_epochs( ['en', 'fr', 'zh'], num_epochs=num_epochs), indices=[[0, 0], [0, 1], [2, 0]], - shape=[3, 2]) + dense_shape=[3, 2]) } return features, tf.constant([1., 0., 0.2], dtype=tf.float32) @@ -878,7 +878,7 @@ class DNNRegressorTest(tf.test.TestCase): values=tf.train.limit_epochs( ['en', 'fr', 'zh'], num_epochs=num_epochs), indices=[[0, 0], [0, 1], [2, 0]], - shape=[3, 2]) + dense_shape=[3, 2]) } return features, tf.constant(labels, dtype=tf.float32) @@ -912,7 +912,7 @@ class DNNRegressorTest(tf.test.TestCase): values=tf.train.limit_epochs( ['en', 'fr', 'zh'], num_epochs=num_epochs), indices=[[0, 0], [0, 1], [2, 0]], - shape=[3, 2]) + dense_shape=[3, 2]) } return features, tf.constant(labels, dtype=tf.float32) @@ -1051,7 +1051,7 @@ class DNNRegressorTest(tf.test.TestCase): values=tf.train.limit_epochs( ['en', 'fr', 'zh'], num_epochs=num_epochs), indices=[[0, 0], [0, 1], [2, 0]], - shape=[3, 2]) + dense_shape=[3, 2]) } return features, tf.constant([1., 0., 0.2], dtype=tf.float32) @@ -1092,7 +1092,7 @@ class DNNRegressorTest(tf.test.TestCase): values=tf.train.limit_epochs( ['en', 'fr', 'zh'], num_epochs=num_epochs), indices=[[0, 0], [0, 1], [2, 0]], - shape=[3, 2]) + dense_shape=[3, 2]) } return features, tf.constant([1., 0., 0.2], dtype=tf.float32) @@ -1138,7 +1138,7 @@ class DNNRegressorTest(tf.test.TestCase): values=tf.train.limit_epochs( ['en', 'fr', 'zh'], num_epochs=num_epochs), indices=[[0, 0], [0, 1], [2, 0]], - shape=[3, 2]) + dense_shape=[3, 2]) } return features, tf.constant([1., 0., 0.2], dtype=tf.float32) @@ -1171,7 +1171,7 @@ class DNNRegressorTest(tf.test.TestCase): values=tf.train.limit_epochs( ['en', 'fr', 'zh'], num_epochs=num_epochs), indices=[[0, 0], [0, 1], [2, 0]], - shape=[3, 2]) + dense_shape=[3, 2]) } return features, tf.constant([1., 0., 0.2], dtype=tf.float32) diff --git a/tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator_test.py b/tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator_test.py index 67f540d410..3fb7430202 100644 --- a/tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator_test.py +++ b/tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator_test.py @@ -109,7 +109,7 @@ class DynamicRnnEstimatorTest(tf.test.TestCase): 'location': tf.SparseTensor( indices=[[0, 0], [1, 0], [2, 0]], values=['west_side', 'west_side', 'nyc'], - shape=[3, 1]), + dense_shape=[3, 1]), 'wire_cast': tf.SparseTensor( indices=[[0, 0, 0], [0, 1, 0], [1, 0, 0], [1, 1, 0], [1, 1, 1], @@ -117,7 +117,7 @@ class DynamicRnnEstimatorTest(tf.test.TestCase): values=[b'marlo', b'stringer', b'omar', b'stringer', b'marlo', b'marlo'], - shape=[3, 2, 2]), + dense_shape=[3, 2, 2]), 'measurements': tf.random_uniform([3, 2, 2], seed=4711)} def GetClassificationTargetsOrNone(self, mode): diff --git a/tensorflow/contrib/learn/python/learn/estimators/linear_test.py b/tensorflow/contrib/learn/python/learn/estimators/linear_test.py index 2a5eb29ef9..7f2aa371fb 100644 --- a/tensorflow/contrib/learn/python/learn/estimators/linear_test.py +++ b/tensorflow/contrib/learn/python/learn/estimators/linear_test.py @@ -1253,7 +1253,7 @@ class LinearRegressorTest(tf.test.TestCase): 'country': tf.SparseTensor( values=['IT', 'US', 'GB'], indices=[[0, 0], [1, 3], [2, 1]], - shape=[3, 5]), + dense_shape=[3, 5]), 'weights': tf.constant([[3.0], [5.0], [7.0]]) }, tf.constant([[1.55], [-1.25], [-3.0]]) @@ -1285,7 +1285,7 @@ class LinearRegressorTest(tf.test.TestCase): 'country': tf.SparseTensor( values=['IT', 'US', 'GB'], indices=[[0, 0], [1, 3], [2, 1]], - shape=[3, 5]), + dense_shape=[3, 5]), 'weights': tf.constant([[10.0], [10.0], [10.0]]) }, tf.constant([[1.4], [-0.8], [2.6]]) -- cgit v1.2.3