visibility = ["//tensorflow:__subpackages__"],
deps = [
"//tensorflow/contrib/autograph/converters",
+ "//tensorflow/contrib/autograph/operators",
"//tensorflow/contrib/autograph/pyct",
"//tensorflow/contrib/autograph/pyct/static_analysis",
"//tensorflow/contrib/autograph/utils",
NO_SIDE_EFFECT_CONSTRUCTORS = set(('tensorflow',))
-# TODO(mdan): Also allow controlling the generated names (for testability).
+# TODO(mdan): Also allow controlling the generated names.
+# TODO(mdan); Consolidate all internal imports into a single __ag module.
COMPILED_IMPORT_STATEMENTS = (
- 'from __future__ import print_function', 'import tensorflow as tf',
- 'from tensorflow.contrib.autograph.impl import api as '
- 'autograph_api',
- 'from tensorflow.contrib.autograph import utils as '
- 'autograph_utils')
+ 'from __future__ import print_function',
+ 'import tensorflow as tf',
+ 'from tensorflow.contrib.autograph.impl import api'
+ ' as autograph_api',
+ 'from tensorflow.contrib.autograph import utils'
+ ' as autograph_utils',
+ 'from tensorflow.contrib.autograph import operators'
+ ' as __ops',
+)
--- /dev/null
+licenses(["notice"]) # Apache 2.0
+
+exports_files(["LICENSE"])
+
+filegroup(
+ name = "all_files",
+ srcs = glob(
+ ["**/*"],
+ exclude = [
+ "**/METADATA",
+ "**/OWNERS",
+ ],
+ ),
+ visibility = ["//tensorflow:__subpackages__"],
+)
+
+py_library(
+ name = "operators",
+ srcs = [
+ "__init__.py",
+ ],
+ srcs_version = "PY2AND3",
+ visibility = ["//tensorflow:__subpackages__"],
+ deps = [],
+)
--- /dev/null
+# Copyright 2018 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.
+# ==============================================================================
+"""This module implements operators that we overload.
+
+Note that "operator" is used loosely here, and includes control structures like
+conditionals and loops, implemented in functional form, using for example
+closures for the body.
+"""
+
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function