diff options
author | 2016-06-01 13:02:59 -0800 | |
---|---|---|
committer | 2016-06-01 14:17:47 -0700 | |
commit | 206cbd06424e5819f5e3024bad1b64e3f7e7bc3f (patch) | |
tree | 2f28e25e47548670a1e5ac277c170693fbf6128b | |
parent | ed15987bb7698d4019c24877420d16d072028f6a (diff) |
renaming files
Change: 123791949
-rw-r--r-- | tensorflow/contrib/learn/BUILD | 104 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/ops/tests/dropout_ops_test.py | 49 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/ops/tests/ops_test.py (renamed from tensorflow/contrib/learn/python/learn/ops/tests/test_ops.py) | 1 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/ops/tests/seq2seq_ops_test.py (renamed from tensorflow/contrib/learn/python/learn/ops/tests/test_seq2seq_ops.py) | 1 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/preprocessing/tests/categorical_test.py (renamed from tensorflow/contrib/learn/python/learn/preprocessing/tests/test_categorical.py) | 1 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/preprocessing/tests/categorical_vocabulary_test.py (renamed from tensorflow/contrib/learn/python/learn/preprocessing/tests/test_categorical_vocabulary.py) | 1 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/preprocessing/tests/text_test.py (renamed from tensorflow/contrib/learn/python/learn/preprocessing/tests/test_text.py) | 0 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/base_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/test_base.py) | 19 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/custom_decay_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/test_custom_decay.py) | 1 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/data_feeder_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/test_data_feeder.py) | 1 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/dataframe/batch_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/dataframe/test_batch.py) | 0 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/dataframe/csv_parser_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/dataframe/test_csv_parser.py) | 0 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/dataframe/dataframe_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/dataframe/test_dataframe.py) | 1 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/dataframe/example_parser_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/dataframe/test_example_parser.py) | 6 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_queue_runner_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/dataframe/test_feeding_queue_runner.py) | 3 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/dataframe/in_memory_source_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/dataframe/test_in_memory_source.py) | 0 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/dataframe/reader_source_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/dataframe/test_reader_source.py) | 0 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/dataframe/series_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/dataframe/test_series.py) | 0 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/dataframe/transform_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/dataframe/test_transform.py) | 0 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/early_stopping_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/test_early_stopping.py) | 9 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/estimators_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/test_estimators.py) | 1 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/grid_search_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/test_grid_search.py) | 1 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/io_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/test_io.py) | 2 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/multioutput_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/test_multioutput.py) | 1 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/nonlinear_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/test_nonlinear.py) | 24 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/regression_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/test_regression.py) | 1 | ||||
-rw-r--r-- | tensorflow/contrib/learn/python/learn/tests/saver_test.py (renamed from tensorflow/contrib/learn/python/learn/tests/test_saver.py) | 1 | ||||
-rw-r--r-- | tensorflow/contrib/testing/BUILD | 2 | ||||
-rw-r--r-- | tensorflow/contrib/testing/__init__.py | 2 | ||||
-rw-r--r-- | tensorflow/contrib/testing/python/framework/util_test.py (renamed from tensorflow/contrib/testing/python/framework/test_util.py) | 0 |
30 files changed, 137 insertions, 95 deletions
diff --git a/tensorflow/contrib/learn/BUILD b/tensorflow/contrib/learn/BUILD index a5cf12406a..a81b00217e 100644 --- a/tensorflow/contrib/learn/BUILD +++ b/tensorflow/contrib/learn/BUILD @@ -26,9 +26,9 @@ py_library( ) py_test( - name = "test_base", + name = "base_test", size = "medium", - srcs = ["python/learn/tests/test_base.py"], + srcs = ["python/learn/tests/base_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -38,9 +38,9 @@ py_test( ) py_test( - name = "test_custom_decay", + name = "custom_decay_test", size = "small", - srcs = ["python/learn/tests/test_custom_decay.py"], + srcs = ["python/learn/tests/custom_decay_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -50,9 +50,9 @@ py_test( ) py_test( - name = "test_data_feeder", + name = "data_feeder_test", size = "small", - srcs = ["python/learn/tests/test_data_feeder.py"], + srcs = ["python/learn/tests/data_feeder_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -62,10 +62,10 @@ py_test( ) py_test( - name = "test_feeding_queue_runner", + name = "feeding_queue_runner_test", size = "small", srcs = [ - "python/learn/tests/dataframe/test_feeding_queue_runner.py", + "python/learn/tests/dataframe/feeding_queue_runner_test.py", ], srcs_version = "PY2AND3", deps = [ @@ -76,9 +76,9 @@ py_test( ) py_test( - name = "test_dataframe", + name = "dataframe_test", size = "small", - srcs = ["python/learn/tests/dataframe/test_dataframe.py"], + srcs = ["python/learn/tests/dataframe/dataframe_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -88,9 +88,9 @@ py_test( ) py_test( - name = "test_series", + name = "series_test", size = "small", - srcs = ["python/learn/tests/dataframe/test_series.py"], + srcs = ["python/learn/tests/dataframe/series_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -100,9 +100,9 @@ py_test( ) py_test( - name = "test_transform", + name = "transform_test", size = "small", - srcs = ["python/learn/tests/dataframe/test_transform.py"], + srcs = ["python/learn/tests/dataframe/transform_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -112,11 +112,11 @@ py_test( ) py_test( - name = "test_reader_source", + name = "reader_source_test", size = "small", srcs = [ "python/learn/dataframe/transforms/reader_source.py", - "python/learn/tests/dataframe/test_reader_source.py", + "python/learn/tests/dataframe/reader_source_test.py", ], srcs_version = "PY2AND3", deps = [ @@ -126,9 +126,9 @@ py_test( ) py_test( - name = "test_csv_parser", + name = "csv_parser_test", size = "small", - srcs = ["python/learn/tests/dataframe/test_csv_parser.py"], + srcs = ["python/learn/tests/dataframe/csv_parser_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -138,9 +138,9 @@ py_test( ) py_test( - name = "test_example_parser", + name = "example_parser_test", size = "small", - srcs = ["python/learn/tests/dataframe/test_example_parser.py"], + srcs = ["python/learn/tests/dataframe/example_parser_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -150,9 +150,9 @@ py_test( ) py_test( - name = "test_in_memory_source", + name = "in_memory_source_test", size = "small", - srcs = ["python/learn/tests/dataframe/test_in_memory_source.py"], + srcs = ["python/learn/tests/dataframe/in_memory_source_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -162,9 +162,9 @@ py_test( ) py_test( - name = "test_batch", + name = "batch_test", size = "small", - srcs = ["python/learn/tests/dataframe/test_batch.py"], + srcs = ["python/learn/tests/dataframe/batch_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -174,9 +174,9 @@ py_test( ) py_test( - name = "test_early_stopping", + name = "early_stopping_test", size = "medium", - srcs = ["python/learn/tests/test_early_stopping.py"], + srcs = ["python/learn/tests/early_stopping_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -186,9 +186,9 @@ py_test( ) py_test( - name = "test_estimators", + name = "estimators_test", size = "small", - srcs = ["python/learn/tests/test_estimators.py"], + srcs = ["python/learn/tests/estimators_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -269,9 +269,9 @@ py_test( ) py_test( - name = "test_grid_search", + name = "grid_search_test", size = "small", - srcs = ["python/learn/tests/test_grid_search.py"], + srcs = ["python/learn/tests/grid_search_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -281,9 +281,9 @@ py_test( ) py_test( - name = "test_io", + name = "io_test", size = "small", - srcs = ["python/learn/tests/test_io.py"], + srcs = ["python/learn/tests/io_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -293,9 +293,9 @@ py_test( ) py_test( - name = "test_multioutput", + name = "multioutput_test", size = "small", - srcs = ["python/learn/tests/test_multioutput.py"], + srcs = ["python/learn/tests/multioutput_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -305,9 +305,9 @@ py_test( ) py_test( - name = "test_nonlinear", + name = "nonlinear_test", size = "medium", - srcs = ["python/learn/tests/test_nonlinear.py"], + srcs = ["python/learn/tests/nonlinear_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -317,9 +317,9 @@ py_test( ) py_test( - name = "test_regression", + name = "regression_test", size = "small", - srcs = ["python/learn/tests/test_regression.py"], + srcs = ["python/learn/tests/regression_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -329,9 +329,9 @@ py_test( ) py_test( - name = "test_saver", + name = "saver_test", size = "small", - srcs = ["python/learn/tests/test_saver.py"], + srcs = ["python/learn/tests/saver_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -341,9 +341,9 @@ py_test( ) py_test( - name = "test_ops", + name = "ops_test", size = "small", - srcs = ["python/learn/ops/tests/test_ops.py"], + srcs = ["python/learn/ops/tests/ops_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -353,9 +353,9 @@ py_test( ) py_test( - name = "test_dropout_ops", + name = "dropout_ops_test", size = "small", - srcs = ["python/learn/ops/tests/test_dropout_ops.py"], + srcs = ["python/learn/ops/tests/dropout_ops_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -365,9 +365,9 @@ py_test( ) py_test( - name = "test_seq2seq_ops", + name = "seq2seq_ops_test", size = "small", - srcs = ["python/learn/ops/tests/test_seq2seq_ops.py"], + srcs = ["python/learn/ops/tests/seq2seq_ops_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -377,9 +377,9 @@ py_test( ) py_test( - name = "test_categorical", + name = "categorical_test", size = "small", - srcs = ["python/learn/preprocessing/tests/test_categorical.py"], + srcs = ["python/learn/preprocessing/tests/categorical_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -389,9 +389,9 @@ py_test( ) py_test( - name = "test_categorical_vocabulary", + name = "categorical_vocabulary_test", size = "small", - srcs = ["python/learn/preprocessing/tests/test_categorical_vocabulary.py"], + srcs = ["python/learn/preprocessing/tests/categorical_vocabulary_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", @@ -401,9 +401,9 @@ py_test( ) py_test( - name = "test_text", + name = "text_test", size = "small", - srcs = ["python/learn/preprocessing/tests/test_text.py"], + srcs = ["python/learn/preprocessing/tests/text_test.py"], srcs_version = "PY2AND3", deps = [ ":learn", diff --git a/tensorflow/contrib/learn/python/learn/ops/tests/dropout_ops_test.py b/tensorflow/contrib/learn/python/learn/ops/tests/dropout_ops_test.py new file mode 100644 index 0000000000..4ce38b49eb --- /dev/null +++ b/tensorflow/contrib/learn/python/learn/ops/tests/dropout_ops_test.py @@ -0,0 +1,49 @@ +# pylint: disable=g-bad-file-header +# 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. +# ============================================================================== +"""Dropout tests.""" + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import tensorflow as tf + +from tensorflow.contrib.learn.python.learn import ops + + +class DropoutTest(tf.test.TestCase): + """Dropout tests.""" + + def test_dropout_float(self): + with self.test_session() as session: + x = tf.placeholder(tf.float32, [5, 5]) + ops.dropout(x, 0.5) + probs = tf.get_collection(ops.DROPOUTS) + session.run(tf.initialize_all_variables()) + self.assertEqual(len(probs), 1) + self.assertEqual(session.run(probs[0]), 0.5) + + def test_dropout_tensor(self): + with self.test_session(): + x = tf.placeholder(tf.float32, [5, 5]) + y = tf.get_variable("prob", [], initializer=tf.constant_initializer(0.5)) + ops.dropout(x, y) + probs = tf.get_collection(ops.DROPOUTS) + self.assertEqual(probs, [y]) + + +if __name__ == "__main__": + tf.test.main() diff --git a/tensorflow/contrib/learn/python/learn/ops/tests/test_ops.py b/tensorflow/contrib/learn/python/learn/ops/tests/ops_test.py index 42a4112a71..554fc42bfa 100644 --- a/tensorflow/contrib/learn/python/learn/ops/tests/test_ops.py +++ b/tensorflow/contrib/learn/python/learn/ops/tests/ops_test.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Ops tests.""" from __future__ import absolute_import diff --git a/tensorflow/contrib/learn/python/learn/ops/tests/test_seq2seq_ops.py b/tensorflow/contrib/learn/python/learn/ops/tests/seq2seq_ops_test.py index b2d2c6306c..ef0639bd6a 100644 --- a/tensorflow/contrib/learn/python/learn/ops/tests/test_seq2seq_ops.py +++ b/tensorflow/contrib/learn/python/learn/ops/tests/seq2seq_ops_test.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Sequence-to-sequence tests.""" from __future__ import absolute_import diff --git a/tensorflow/contrib/learn/python/learn/preprocessing/tests/test_categorical.py b/tensorflow/contrib/learn/python/learn/preprocessing/tests/categorical_test.py index 434e66cade..ea0f9c584e 100644 --- a/tensorflow/contrib/learn/python/learn/preprocessing/tests/test_categorical.py +++ b/tensorflow/contrib/learn/python/learn/preprocessing/tests/categorical_test.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Categorical tests.""" # limitations under the License. diff --git a/tensorflow/contrib/learn/python/learn/preprocessing/tests/test_categorical_vocabulary.py b/tensorflow/contrib/learn/python/learn/preprocessing/tests/categorical_vocabulary_test.py index 259e1f447f..d6123994d7 100644 --- a/tensorflow/contrib/learn/python/learn/preprocessing/tests/test_categorical_vocabulary.py +++ b/tensorflow/contrib/learn/python/learn/preprocessing/tests/categorical_vocabulary_test.py @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Categorical vocabulary tests.""" from __future__ import absolute_import diff --git a/tensorflow/contrib/learn/python/learn/preprocessing/tests/test_text.py b/tensorflow/contrib/learn/python/learn/preprocessing/tests/text_test.py index d5e5c2155a..d5e5c2155a 100644 --- a/tensorflow/contrib/learn/python/learn/preprocessing/tests/test_text.py +++ b/tensorflow/contrib/learn/python/learn/preprocessing/tests/text_test.py diff --git a/tensorflow/contrib/learn/python/learn/tests/test_base.py b/tensorflow/contrib/learn/python/learn/tests/base_test.py index f0253f44e0..2a7a0d625e 100644 --- a/tensorflow/contrib/learn/python/learn/tests/test_base.py +++ b/tensorflow/contrib/learn/python/learn/tests/base_test.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Test base estimators.""" from __future__ import absolute_import @@ -64,16 +63,14 @@ class BaseTest(tf.test.TestCase): iris = datasets.load_iris() classifier = learn.TensorFlowLinearClassifier(n_classes=3) classifier.fit(iris.data, [float(x) for x in iris.target]) - self.assertEqual( - classifier.get_variable_names(), - ["OptimizeLoss/learning_rate", - "OptimizeLoss/logistic_regression/bias/Adagrad", - "OptimizeLoss/logistic_regression/softmax_classifier/" - "softmax_cross_entropy_loss/value/avg", - "OptimizeLoss/logistic_regression/weights/Adagrad", - "global_step", - "logistic_regression/bias", - "logistic_regression/weights"]) + self.assertEqual(classifier.get_variable_names(), + ["OptimizeLoss/learning_rate", + "OptimizeLoss/logistic_regression/bias/Adagrad", + "OptimizeLoss/logistic_regression/softmax_classifier/" + "softmax_cross_entropy_loss/value/avg", + "OptimizeLoss/logistic_regression/weights/Adagrad", + "global_step", "logistic_regression/bias", + "logistic_regression/weights"]) def testIrisSummaries(self): iris = datasets.load_iris() diff --git a/tensorflow/contrib/learn/python/learn/tests/test_custom_decay.py b/tensorflow/contrib/learn/python/learn/tests/custom_decay_test.py index fb1b7e91c3..6304f2363d 100644 --- a/tensorflow/contrib/learn/python/learn/tests/test_custom_decay.py +++ b/tensorflow/contrib/learn/python/learn/tests/custom_decay_test.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Custom decay tests.""" from __future__ import absolute_import diff --git a/tensorflow/contrib/learn/python/learn/tests/test_data_feeder.py b/tensorflow/contrib/learn/python/learn/tests/data_feeder_test.py index 443036cd6e..94688322eb 100644 --- a/tensorflow/contrib/learn/python/learn/tests/test_data_feeder.py +++ b/tensorflow/contrib/learn/python/learn/tests/data_feeder_test.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Tests for `DataFeeder`.""" from __future__ import absolute_import diff --git a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_batch.py b/tensorflow/contrib/learn/python/learn/tests/dataframe/batch_test.py index 4221fda9e5..4221fda9e5 100644 --- a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_batch.py +++ b/tensorflow/contrib/learn/python/learn/tests/dataframe/batch_test.py diff --git a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_csv_parser.py b/tensorflow/contrib/learn/python/learn/tests/dataframe/csv_parser_test.py index 4b9177ab78..4b9177ab78 100644 --- a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_csv_parser.py +++ b/tensorflow/contrib/learn/python/learn/tests/dataframe/csv_parser_test.py diff --git a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_dataframe.py b/tensorflow/contrib/learn/python/learn/tests/dataframe/dataframe_test.py index 7cb9c2ce2e..a0a5819fac 100644 --- a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_dataframe.py +++ b/tensorflow/contrib/learn/python/learn/tests/dataframe/dataframe_test.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Tests of the DataFrame class.""" from __future__ import absolute_import diff --git a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_example_parser.py b/tensorflow/contrib/learn/python/learn/tests/dataframe/example_parser_test.py index c4ccf6ba9a..0c0057bbf2 100644 --- a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_example_parser.py +++ b/tensorflow/contrib/learn/python/learn/tests/dataframe/example_parser_test.py @@ -84,9 +84,9 @@ class ExampleParserTestCase(tf.test.TestCase): dtype=tf.int64, default_value=[0, 0, 0]))) - self.expected_string_values = np.array( - list(self.example1.features.feature["string_feature"].bytes_list.value) + - list(self.example2.features.feature["string_feature"].bytes_list.value)) + self.expected_string_values = np.array(list(self.example1.features.feature[ + "string_feature"].bytes_list.value) + list( + self.example2.features.feature["string_feature"].bytes_list.value)) self.expected_string_indices = np.array([[0, 0], [1, 0], [1, 1]]) self.expected_int_feature = np.array([list(self.example1.features.feature[ "int_feature"].int64_list.value), list(self.example2.features.feature[ diff --git a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_feeding_queue_runner.py b/tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_queue_runner_test.py index b4d1eed859..4e7634557f 100644 --- a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_feeding_queue_runner.py +++ b/tensorflow/contrib/learn/python/learn/tests/dataframe/feeding_queue_runner_test.py @@ -1,5 +1,4 @@ -# pylint: disable=g-bad-file-header -# Copyright 2016 The TensorFlow Authors. All Rights Reserved. +# Copyright 2016 Google Inc. 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. diff --git a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_in_memory_source.py b/tensorflow/contrib/learn/python/learn/tests/dataframe/in_memory_source_test.py index e1f759d32d..e1f759d32d 100644 --- a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_in_memory_source.py +++ b/tensorflow/contrib/learn/python/learn/tests/dataframe/in_memory_source_test.py diff --git a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_reader_source.py b/tensorflow/contrib/learn/python/learn/tests/dataframe/reader_source_test.py index ea61637d1a..ea61637d1a 100644 --- a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_reader_source.py +++ b/tensorflow/contrib/learn/python/learn/tests/dataframe/reader_source_test.py diff --git a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_series.py b/tensorflow/contrib/learn/python/learn/tests/dataframe/series_test.py index 71af6bce38..71af6bce38 100644 --- a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_series.py +++ b/tensorflow/contrib/learn/python/learn/tests/dataframe/series_test.py diff --git a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_transform.py b/tensorflow/contrib/learn/python/learn/tests/dataframe/transform_test.py index b524c73e5c..b524c73e5c 100644 --- a/tensorflow/contrib/learn/python/learn/tests/dataframe/test_transform.py +++ b/tensorflow/contrib/learn/python/learn/tests/dataframe/transform_test.py diff --git a/tensorflow/contrib/learn/python/learn/tests/test_early_stopping.py b/tensorflow/contrib/learn/python/learn/tests/early_stopping_test.py index 6492294edc..818ea38e15 100644 --- a/tensorflow/contrib/learn/python/learn/tests/test_early_stopping.py +++ b/tensorflow/contrib/learn/python/learn/tests/early_stopping_test.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Early stopping tests.""" from __future__ import absolute_import @@ -41,9 +40,11 @@ class EarlyStoppingTest(tf.test.TestCase): test_size=0.2, random_state=42) - x_train, x_val, y_train, y_val = train_test_split( - x_train, y_train, test_size=0.2) - val_monitor = learn.monitors.ValidationMonitor(x_val, y_val, + x_train, x_val, y_train, y_val = train_test_split(x_train, + y_train, + test_size=0.2) + val_monitor = learn.monitors.ValidationMonitor(x_val, + y_val, early_stopping_rounds=100) # classifier without early stopping - overfitting diff --git a/tensorflow/contrib/learn/python/learn/tests/test_estimators.py b/tensorflow/contrib/learn/python/learn/tests/estimators_test.py index 02bb3e4f94..65d8ab075f 100644 --- a/tensorflow/contrib/learn/python/learn/tests/test_estimators.py +++ b/tensorflow/contrib/learn/python/learn/tests/estimators_test.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Custom optimizer tests.""" from __future__ import absolute_import diff --git a/tensorflow/contrib/learn/python/learn/tests/test_grid_search.py b/tensorflow/contrib/learn/python/learn/tests/grid_search_test.py index 5cb25ca6a0..f073286b4c 100644 --- a/tensorflow/contrib/learn/python/learn/tests/test_grid_search.py +++ b/tensorflow/contrib/learn/python/learn/tests/grid_search_test.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Grid search tests.""" from __future__ import absolute_import diff --git a/tensorflow/contrib/learn/python/learn/tests/test_io.py b/tensorflow/contrib/learn/python/learn/tests/io_test.py index 3bbec5fde9..9643923dc5 100644 --- a/tensorflow/contrib/learn/python/learn/tests/test_io.py +++ b/tensorflow/contrib/learn/python/learn/tests/io_test.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """tf.learn IO operation tests.""" from __future__ import absolute_import @@ -29,6 +28,7 @@ from tensorflow.contrib.learn.python.learn import datasets from tensorflow.contrib.learn.python.learn.estimators._sklearn import accuracy_score # pylint: disable=wildcard-import from tensorflow.contrib.learn.python.learn.io import * + # pylint: enable=wildcard-import diff --git a/tensorflow/contrib/learn/python/learn/tests/test_multioutput.py b/tensorflow/contrib/learn/python/learn/tests/multioutput_test.py index a2db7bf5ba..ff0cbcf465 100644 --- a/tensorflow/contrib/learn/python/learn/tests/test_multioutput.py +++ b/tensorflow/contrib/learn/python/learn/tests/multioutput_test.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Multi-output tests.""" from __future__ import absolute_import diff --git a/tensorflow/contrib/learn/python/learn/tests/test_nonlinear.py b/tensorflow/contrib/learn/python/learn/tests/nonlinear_test.py index 007bb6ea6d..47ee09db80 100644 --- a/tensorflow/contrib/learn/python/learn/tests/test_nonlinear.py +++ b/tensorflow/contrib/learn/python/learn/tests/nonlinear_test.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Non-linear estimator tests.""" from __future__ import absolute_import @@ -51,8 +50,11 @@ class NonLinearTest(tf.test.TestCase): random.seed(42) boston = tf.contrib.learn.datasets.load_boston() regressor = tf.contrib.learn.TensorFlowDNNRegressor( - hidden_units=[10, 20, 10], n_classes=0, - batch_size=boston.data.shape[0], steps=300, learning_rate=0.001) + hidden_units=[10, 20, 10], + n_classes=0, + batch_size=boston.data.shape[0], + steps=300, + learning_rate=0.001) regressor.fit(boston.data, boston.target) score = mean_squared_error(boston.target, regressor.predict(boston.data)) self.assertLess(score, 110, "Failed with score = {0}".format(score)) @@ -68,7 +70,8 @@ class NonLinearTest(tf.test.TestCase): # Dropout prob == 0. iris = tf.contrib.learn.datasets.load_iris() classifier = tf.contrib.learn.TensorFlowDNNClassifier( - hidden_units=[10, 20, 10], n_classes=3, dropout=0.0) + hidden_units=[10, 20, 10], + n_classes=3, dropout=0.0) classifier.fit(iris.data, iris.target) score = accuracy_score(iris.target, classifier.predict(iris.data)) self.assertGreater(score, 0.9, "Failed with score = {0}".format(score)) @@ -77,7 +80,8 @@ class NonLinearTest(tf.test.TestCase): # Dropping only a little. iris = tf.contrib.learn.datasets.load_iris() classifier = tf.contrib.learn.TensorFlowDNNClassifier( - hidden_units=[10, 20, 10], n_classes=3, dropout=0.1) + hidden_units=[10, 20, 10], + n_classes=3, dropout=0.1) classifier.fit(iris.data, iris.target) score = accuracy_score(iris.target, classifier.predict(iris.data)) # If the quality is lower - dropout is not working. @@ -87,7 +91,8 @@ class NonLinearTest(tf.test.TestCase): # Dropping out most of it. iris = tf.contrib.learn.datasets.load_iris() classifier = tf.contrib.learn.TensorFlowDNNClassifier( - hidden_units=[10, 20, 10], n_classes=3, dropout=0.9) + hidden_units=[10, 20, 10], + n_classes=3, dropout=0.9) classifier.fit(iris.data, iris.target) score = accuracy_score(iris.target, classifier.predict(iris.data)) self.assertGreater(score, 0.3, "Failed with score = {0}".format(score)) @@ -130,8 +135,11 @@ class NonLinearTest(tf.test.TestCase): num_layers=2) classifier.fit(data, labels) classifier = tf.contrib.learn.TensorFlowRNNClassifier( - rnn_size=2, cell_type="invalid_cell_type", n_classes=2, - input_op_fn=_input_fn, num_layers=2) + rnn_size=2, + cell_type="invalid_cell_type", + n_classes=2, + input_op_fn=_input_fn, + num_layers=2) with self.assertRaises(ValueError): classifier.fit(data, labels) diff --git a/tensorflow/contrib/learn/python/learn/tests/test_regression.py b/tensorflow/contrib/learn/python/learn/tests/regression_test.py index e5a5018387..109bb21c7b 100644 --- a/tensorflow/contrib/learn/python/learn/tests/test_regression.py +++ b/tensorflow/contrib/learn/python/learn/tests/regression_test.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Linear regression tests.""" from __future__ import absolute_import diff --git a/tensorflow/contrib/learn/python/learn/tests/test_saver.py b/tensorflow/contrib/learn/python/learn/tests/saver_test.py index 32cfa2f273..fb42cae481 100644 --- a/tensorflow/contrib/learn/python/learn/tests/test_saver.py +++ b/tensorflow/contrib/learn/python/learn/tests/saver_test.py @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== - """Save and restore tests.""" from __future__ import absolute_import diff --git a/tensorflow/contrib/testing/BUILD b/tensorflow/contrib/testing/BUILD index 21d0b9610c..a4bd7acdde 100644 --- a/tensorflow/contrib/testing/BUILD +++ b/tensorflow/contrib/testing/BUILD @@ -11,7 +11,7 @@ py_library( name = "testing_py", srcs = [ "__init__.py", - "python/framework/test_util.py", + "python/framework/util_test.py", ], srcs_version = "PY2AND3", ) diff --git a/tensorflow/contrib/testing/__init__.py b/tensorflow/contrib/testing/__init__.py index 6807a7dd82..27422fd6d3 100644 --- a/tensorflow/contrib/testing/__init__.py +++ b/tensorflow/contrib/testing/__init__.py @@ -19,4 +19,4 @@ from __future__ import division from __future__ import print_function # pylint: disable=unused-import,wildcard-import -from tensorflow.contrib.testing.python.framework.test_util import * +from tensorflow.contrib.testing.python.framework.util_test import * diff --git a/tensorflow/contrib/testing/python/framework/test_util.py b/tensorflow/contrib/testing/python/framework/util_test.py index 5d1d4fca77..5d1d4fca77 100644 --- a/tensorflow/contrib/testing/python/framework/test_util.py +++ b/tensorflow/contrib/testing/python/framework/util_test.py |