Skip to content

Commit bc20c2b

Browse files
ebrevdotensorflower-gardener
authored andcommitted
Part 2c of renaming SparseTensor.shape -> SparseTensor.dense_shape
Change: 141124954
1 parent a008959 commit bc20c2b

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎tensorflow/contrib/layers/python/layers/embedding_ops.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def safe_embedding_lookup_sparse(embedding_weights,
122122
if sparse_weights is not None:
123123
sparse_weights = sparse_tensor.SparseTensor(
124124
sparse_ids.indices,
125-
sparse_weights.values, sparse_ids.shape)
125+
sparse_weights.values, sparse_ids.dense_shape)
126126

127127
# Prune invalid ids and weights.
128128
sparse_ids, sparse_weights = _prune_invalid_ids(sparse_ids, sparse_weights)

‎tensorflow/contrib/layers/python/layers/feature_column.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def insert_transformed_feature(self, columns_to_tensors):
456456
sparse_id_values = math_ops.mod(input_tensor.values, self.bucket_size,
457457
name="mod")
458458
columns_to_tensors[self] = sparse_tensor_py.SparseTensor(
459-
input_tensor.indices, sparse_id_values, input_tensor.shape)
459+
input_tensor.indices, sparse_id_values, input_tensor.dense_shape)
460460

461461

462462
def sparse_column_with_integerized_feature(column_name,
@@ -530,7 +530,7 @@ def insert_transformed_feature(self, columns_to_tensors):
530530
sparse_id_values = string_ops.string_to_hash_bucket_fast(
531531
sparse_values, self.bucket_size, name="lookup")
532532
columns_to_tensors[self] = sparse_tensor_py.SparseTensor(
533-
input_tensor.indices, sparse_id_values, input_tensor.shape)
533+
input_tensor.indices, sparse_id_values, input_tensor.dense_shape)
534534

535535

536536
def sparse_column_with_hash_bucket(column_name,
@@ -718,7 +718,7 @@ def weighted_sparse_column(sparse_id_column,
718718
is a SparseTensor.
719719
Following are assumed to be true:
720720
* sparse_tensor.indices = weights_tensor.indices
721-
* sparse_tensor.shape = weights_tensor.shape
721+
* sparse_tensor.shape = weights_tensor.dense_shape
722722
723723
Args:
724724
sparse_id_column: A `_SparseColumn` which is created by

‎tensorflow/contrib/layers/python/layers/feature_column_ops.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def _create_joint_embedding_lookup(columns_to_tensors,
371371
sparse_tensors.append(
372372
sparse_tensor_py.SparseTensor(t.indices,
373373
values,
374-
t.shape))
374+
t.dense_shape))
375375
sparse_tensor = sparse_ops.sparse_concat(1, sparse_tensors)
376376
with variable_scope.variable_scope(
377377
None, default_name='linear_weights', values=columns_to_tensors.values()):

0 commit comments

Comments
 (0)