diff options
author | Illia Polosukhin <ipolosukhin@google.com> | 2016-11-03 14:46:06 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-11-03 16:09:01 -0700 |
commit | cbd3cacfb73bbea912b9d01c2540187684f751a7 (patch) | |
tree | c2c22af2d05583491b1370dcabdb2e83cb61e2ee /tensorflow/contrib/metrics/__init__.py | |
parent | 703fce57eaae725c4ae4b0bd23629c4f04a9de16 (diff) |
Replace usages initialize_all_variables -> global_variables_initializer
Change: 138128703
Diffstat (limited to 'tensorflow/contrib/metrics/__init__.py')
-rw-r--r-- | tensorflow/contrib/metrics/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/contrib/metrics/__init__.py b/tensorflow/contrib/metrics/__init__.py index fc98a8d3df..2a23d2689b 100644 --- a/tensorflow/contrib/metrics/__init__.py +++ b/tensorflow/contrib/metrics/__init__.py @@ -31,7 +31,7 @@ to use the `streaming_mean`: ```python value = ... mean_value, update_op = tf.contrib.metrics.streaming_mean(values) -sess.run(tf.initialize_local_variables()) +sess.run(tf.local_variables_initializer()) for i in range(number_of_batches): print('Mean after batch %d: %f' % (i, update_op.eval()) @@ -50,7 +50,7 @@ In the above example, calling streaming_mean creates a pair of state variables that will contain (1) the running sum and (2) the count of the number of samples in the sum. Because the streaming metrics use local variables, the Initialization stage is performed by running the op returned -by `tf.initialize_local_variables()`. It sets the sum and count variables to +by `tf.local_variables_initializer()`. It sets the sum and count variables to zero. Next, Aggregation is performed by examining the current state of `values` @@ -71,7 +71,7 @@ accuracy, update_op_acc = tf.contrib.metrics.streaming_accuracy( error, update_op_error = tf.contrib.metrics.streaming_mean_absolute_error( labels, predictions) -sess.run(tf.initialize_local_variables()) +sess.run(tf.local_variables_initializer()) for batch in range(num_batches): sess.run([update_op_acc, update_op_error]) |