From 65e31297f51af85ee4bfa4817a0d4d1773728ab6 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Thu, 20 Oct 2016 16:30:37 -0800 Subject: [PATCH] Fixes making specs and ndlstm accessible through tf.contrib Change: 136781876 --- tensorflow/contrib/BUILD | 2 ++ tensorflow/contrib/__init__.py | 2 ++ tensorflow/contrib/ndlstm/BUILD | 1 + tensorflow/contrib/ndlstm/__init__.py | 0 .../contrib/ndlstm/python/lstm1d_test.py | 2 +- .../contrib/ndlstm/python/lstm2d_test.py | 2 +- tensorflow/contrib/ndlstm/python/misc_test.py | 2 +- tensorflow/contrib/specs/BUILD | 1 + tensorflow/contrib/specs/__init__.py | 0 tensorflow/contrib/specs/python/__init__.py | 26 +++++++++++++++++++ tensorflow/contrib/specs/python/specs_test.py | 2 +- 11 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 tensorflow/contrib/ndlstm/__init__.py create mode 100644 tensorflow/contrib/specs/__init__.py diff --git a/tensorflow/contrib/BUILD b/tensorflow/contrib/BUILD index b9b5db25870..be325ba2f19 100644 --- a/tensorflow/contrib/BUILD +++ b/tensorflow/contrib/BUILD @@ -29,12 +29,14 @@ py_library( "//tensorflow/contrib/lookup:lookup_py", "//tensorflow/contrib/losses:losses_py", "//tensorflow/contrib/metrics:metrics_py", + "//tensorflow/contrib/ndlstm", "//tensorflow/contrib/opt:opt_py", "//tensorflow/contrib/quantization:quantization_py", "//tensorflow/contrib/rnn:rnn_py", "//tensorflow/contrib/seq2seq:seq2seq_py", "//tensorflow/contrib/slim", "//tensorflow/contrib/slim:nets", + "//tensorflow/contrib/specs", "//tensorflow/contrib/tensor_forest:tensor_forest_py", "//tensorflow/contrib/tensor_forest/hybrid:ops_lib", "//tensorflow/contrib/tensorboard", diff --git a/tensorflow/contrib/__init__.py b/tensorflow/contrib/__init__.py index 75a40d79753..dfeacba6d4d 100644 --- a/tensorflow/contrib/__init__.py +++ b/tensorflow/contrib/__init__.py @@ -45,3 +45,5 @@ from tensorflow.contrib import testing from tensorflow.contrib import tfprof from tensorflow.contrib import training from tensorflow.contrib import util +from tensorflow.contrib.ndlstm import python as ndlstm +from tensorflow.contrib.specs import python as specs diff --git a/tensorflow/contrib/ndlstm/BUILD b/tensorflow/contrib/ndlstm/BUILD index bbfa16321ce..545912d1292 100644 --- a/tensorflow/contrib/ndlstm/BUILD +++ b/tensorflow/contrib/ndlstm/BUILD @@ -13,6 +13,7 @@ load("//tensorflow:tensorflow.bzl", "tf_py_test") py_library( name = "ndlstm", srcs = [ + "__init__.py", "python/__init__.py", "python/lstm1d.py", "python/lstm2d.py", diff --git a/tensorflow/contrib/ndlstm/__init__.py b/tensorflow/contrib/ndlstm/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tensorflow/contrib/ndlstm/python/lstm1d_test.py b/tensorflow/contrib/ndlstm/python/lstm1d_test.py index 1e677e4def5..e4b97011901 100644 --- a/tensorflow/contrib/ndlstm/python/lstm1d_test.py +++ b/tensorflow/contrib/ndlstm/python/lstm1d_test.py @@ -20,7 +20,7 @@ from __future__ import print_function import numpy as np import tensorflow as tf -from tensorflow.contrib.ndlstm.python import lstm1d +lstm1d = tf.contrib.ndlstm.lstm1d def _rand(*size): diff --git a/tensorflow/contrib/ndlstm/python/lstm2d_test.py b/tensorflow/contrib/ndlstm/python/lstm2d_test.py index b9c07e1dab7..502aba1550f 100644 --- a/tensorflow/contrib/ndlstm/python/lstm2d_test.py +++ b/tensorflow/contrib/ndlstm/python/lstm2d_test.py @@ -20,8 +20,8 @@ from __future__ import print_function import numpy as np import tensorflow as tf -from tensorflow.contrib.ndlstm.python import lstm2d from tensorflow.python.framework import test_util +lstm2d = tf.contrib.ndlstm.lstm2d def _rand(*size): diff --git a/tensorflow/contrib/ndlstm/python/misc_test.py b/tensorflow/contrib/ndlstm/python/misc_test.py index a95b5444c79..b648db67054 100644 --- a/tensorflow/contrib/ndlstm/python/misc_test.py +++ b/tensorflow/contrib/ndlstm/python/misc_test.py @@ -19,8 +19,8 @@ from __future__ import print_function import numpy as np import tensorflow as tf -from tensorflow.contrib.ndlstm.python import misc from tensorflow.python.framework import test_util +misc = tf.contrib.ndlstm.misc def _rand(*size): diff --git a/tensorflow/contrib/specs/BUILD b/tensorflow/contrib/specs/BUILD index 517fe4784c6..9c9e99b7930 100644 --- a/tensorflow/contrib/specs/BUILD +++ b/tensorflow/contrib/specs/BUILD @@ -12,6 +12,7 @@ load("//tensorflow:tensorflow.bzl", "tf_py_test") py_library( name = "specs", srcs = [ + "__init__.py", "python/__init__.py", "python/params_ops.py", "python/specs.py", diff --git a/tensorflow/contrib/specs/__init__.py b/tensorflow/contrib/specs/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tensorflow/contrib/specs/python/__init__.py b/tensorflow/contrib/specs/python/__init__.py index e69de29bb2d..1e063e5d31b 100644 --- a/tensorflow/contrib/specs/python/__init__.py +++ b/tensorflow/contrib/specs/python/__init__.py @@ -0,0 +1,26 @@ +# 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. +# ============================================================================== +"""Init file, giving convenient access to all specs ops.""" + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +# pylint: disable=wildcard-import,g-importing-member +from tensorflow.contrib.specs.python.params_ops import * +from tensorflow.contrib.specs.python.specs import * +from tensorflow.contrib.specs.python.specs_lib import * +from tensorflow.contrib.specs.python.specs_ops import * +from tensorflow.contrib.specs.python.summaries import * diff --git a/tensorflow/contrib/specs/python/specs_test.py b/tensorflow/contrib/specs/python/specs_test.py index 71e160f0928..ce13c9f9240 100644 --- a/tensorflow/contrib/specs/python/specs_test.py +++ b/tensorflow/contrib/specs/python/specs_test.py @@ -20,8 +20,8 @@ from __future__ import print_function import numpy as np import tensorflow as tf -from tensorflow.contrib.specs.python import specs from tensorflow.contrib.specs.python import summaries +specs = tf.contrib.specs def _rand(*size):