aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/metrics
diff options
context:
space:
mode:
authorGravatar Yan Facai (颜发才) <facai.yan@gmail.com>2018-09-12 14:59:44 +0800
committerGravatar Yan Facai (颜发才) <facai.yan@gmail.com>2018-09-12 14:59:44 +0800
commite3c334e57fba9afc0b0a3aa5f7787ee35e17ddf6 (patch)
treeab2f4f052a61b8f7b300b654263caab721d91e25 /tensorflow/contrib/metrics
parent2dd5fb6cfb16ccc612b6e278d6282ef90581c0bb (diff)
CLN: remove unnecessary math_ops.maximum
Diffstat (limited to 'tensorflow/contrib/metrics')
-rw-r--r--tensorflow/contrib/metrics/python/ops/metric_ops.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tensorflow/contrib/metrics/python/ops/metric_ops.py b/tensorflow/contrib/metrics/python/ops/metric_ops.py
index d7c73c8f99..91939b5bf2 100644
--- a/tensorflow/contrib/metrics/python/ops/metric_ops.py
+++ b/tensorflow/contrib/metrics/python/ops/metric_ops.py
@@ -3222,11 +3222,11 @@ def streaming_covariance(predictions,
# batch_mean_prediction is E[x_B] in the update equation
batch_mean_prediction = math_ops.div_no_nan(
math_ops.reduce_sum(weighted_predictions),
- math_ops.maximum(batch_count, 0),
+ batch_count,
name='batch_mean_prediction')
delta_mean_prediction = math_ops.div_no_nan(
(batch_mean_prediction - mean_prediction) * batch_count,
- math_ops.maximum(update_count, 0),
+ update_count,
name='delta_mean_prediction')
update_mean_prediction = state_ops.assign_add(mean_prediction,
delta_mean_prediction)
@@ -3236,11 +3236,11 @@ def streaming_covariance(predictions,
# batch_mean_label is E[y_B] in the update equation
batch_mean_label = math_ops.div_no_nan(
math_ops.reduce_sum(weighted_labels),
- math_ops.maximum(batch_count, 0),
+ batch_count,
name='batch_mean_label')
delta_mean_label = math_ops.div_no_nan(
(batch_mean_label - mean_label) * batch_count,
- math_ops.maximum(update_count, 0),
+ update_count,
name='delta_mean_label')
update_mean_label = state_ops.assign_add(mean_label, delta_mean_label)
# prev_mean_label is E[y_A] in the update equation