提交 e1cb0920 编写于 作者: E Eugene Brevdo 提交者: TensorFlower Gardener

Final breaking change of SparseTensor.shape -> SparseTensor.dense_shape rename.

Removing shape property from SparseTensor.
Change: 141489556
上级 e7cba644
......@@ -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
......
......@@ -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)
......
......@@ -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):
......
......@@ -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]])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册