Skip to content

Commit ced4fdd

Browse files
authored
Merge pull request tensorflow#20123 from yongtang/06022018-keep_dims
Fix warning in constrained_optimization test
2 parents ef483ad + b7150cf commit ced4fdd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tensorflow/contrib/constrained_optimization/python/swap_regret_optimizer.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ def while_loop_body(iteration, matrix, inactive, old_inactive):
169169
del old_inactive # Needed by the condition, but not the body.
170170
iteration += 1
171171
scale = (1.0 - standard_ops.reduce_sum(
172-
matrix, axis=0, keep_dims=True)) / standard_ops.maximum(
173-
1.0, standard_ops.reduce_sum(inactive, axis=0, keep_dims=True))
172+
matrix, axis=0, keepdims=True)) / standard_ops.maximum(
173+
1.0, standard_ops.reduce_sum(inactive, axis=0, keepdims=True))
174174
matrix += scale * inactive
175175
new_inactive = standard_ops.to_float(matrix > 0)
176176
matrix *= new_inactive
@@ -206,10 +206,10 @@ def _project_log_stochastic_matrix_wrt_kl_divergence(log_matrix):
206206

207207
# For numerical reasons, make sure that the largest matrix element is zero
208208
# before exponentiating.
209-
log_matrix -= standard_ops.reduce_max(log_matrix, axis=0, keep_dims=True)
209+
log_matrix -= standard_ops.reduce_max(log_matrix, axis=0, keepdims=True)
210210
log_matrix -= standard_ops.log(
211211
standard_ops.reduce_sum(
212-
standard_ops.exp(log_matrix), axis=0, keep_dims=True))
212+
standard_ops.exp(log_matrix), axis=0, keepdims=True))
213213
return log_matrix
214214

215215

0 commit comments

Comments
 (0)