提交 cce0d12e 编写于 作者: D Dan Mané 提交者: TensorFlower Gardener

Create tf.contrib.deprecated, as a space for keeping deprecated summary ops.

When the tf.X_summary ops are removed in the leadup to TensorFlow 1.0, they
will be migrated to tf.contrib.deprecated.X_summary.
Change: 139974976
上级 983d8931
......@@ -17,6 +17,7 @@ py_library(
"//tensorflow/contrib/copy_graph:copy_graph_py",
"//tensorflow/contrib/crf:crf_py",
"//tensorflow/contrib/cudnn_rnn:cudnn_rnn_py",
"//tensorflow/contrib/deprecated:deprecated_py",
"//tensorflow/contrib/distributions:distributions_py",
"//tensorflow/contrib/factorization:factorization_py",
"//tensorflow/contrib/ffmpeg:ffmpeg_ops_py",
......
......@@ -23,6 +23,7 @@ from tensorflow.contrib import bayesflow
from tensorflow.contrib import copy_graph
from tensorflow.contrib import crf
from tensorflow.contrib import cudnn_rnn
from tensorflow.contrib import deprecated
from tensorflow.contrib import distributions
from tensorflow.contrib import factorization
from tensorflow.contrib import framework
......
# Description:
# Contains deprecated functions that we aren't quite ready to remove entirely
licenses(["notice"]) # Apache 2.0
exports_files(["LICENSE"])
package(default_visibility = ["//tensorflow:__subpackages__"])
py_library(
name = "deprecated_py",
srcs = [
"__init__.py",
"summaries.py",
],
srcs_version = "PY2AND3",
deps = ["//tensorflow/python:logging_ops"],
)
py_test(
name = "summaries_test",
srcs = ["summaries_test.py"],
srcs_version = "PY2AND3",
deps = [
":deprecated_py",
"//tensorflow:tensorflow_py",
],
)
filegroup(
name = "all_files",
srcs = glob(
["**/*"],
exclude = [
"**/METADATA",
"**/OWNERS",
],
),
visibility = ["//tensorflow:__subpackages__"],
)
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Deprecated endpoints that we aren't yet ready to remove entirely.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: disable=unused-import,line-too-long
from tensorflow.contrib.deprecated.summaries import audio_summary
from tensorflow.contrib.deprecated.summaries import histogram_summary
from tensorflow.contrib.deprecated.summaries import image_summary
from tensorflow.contrib.deprecated.summaries import merge_all_summaries
from tensorflow.contrib.deprecated.summaries import merge_summary
from tensorflow.contrib.deprecated.summaries import scalar_summary
# pylint: enable=unused-import,line-too-long
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Deprecated endpoints that we aren't yet ready to remove entirely.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# When the endpoints are removed from core TensorFlow, the old implementations
# will move to this file.
# pylint: disable=unused-import,line-too-long
from tensorflow.python.ops.logging_ops import audio_summary
from tensorflow.python.ops.logging_ops import histogram_summary
from tensorflow.python.ops.logging_ops import image_summary
from tensorflow.python.ops.logging_ops import merge_all_summaries
from tensorflow.python.ops.logging_ops import merge_summary
from tensorflow.python.ops.logging_ops import scalar_summary
# pylint: enable=unused-import,line-too-long
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Tests for the deprecated summary ops in tf.contrib.deprecated."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
class DeprecatedSummariesTest(tf.test.TestCase):
def testScalarSummary(self):
with self.test_session():
c = tf.constant(3)
s = tf.contrib.deprecated.scalar_summary('tag', c)
self.assertEqual(s.op.type, u'ScalarSummary')
def testHistogramSummary(self):
with self.test_session():
c = tf.constant(3)
s = tf.contrib.deprecated.histogram_summary('tag', c)
self.assertEqual(s.op.type, u'HistogramSummary')
def testImageSummary(self):
with self.test_session():
i = tf.ones((5, 4, 4, 3))
s = tf.contrib.deprecated.image_summary('tag', i)
self.assertEqual(s.op.type, u'ImageSummary')
def testAudioSummary(self):
with self.test_session():
c = tf.constant(3.0)
s = tf.contrib.deprecated.audio_summary('tag', c, sample_rate=8000)
self.assertEqual(s.op.type, u'AudioSummaryV2')
def testMergeSummary(self):
with self.test_session():
c = tf.constant(3)
a = tf.contrib.deprecated.scalar_summary('a', c)
b = tf.contrib.deprecated.scalar_summary('b', c)
s = tf.contrib.deprecated.merge_summary([a, b])
self.assertEqual(s.op.type, u'MergeSummary')
if __name__ == '__main__':
tf.test.main()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册