Move AutoGraph to core. This CL moves the entirety of the code base, keeping the frontend autograph module in contrib for backward compatibility. Certain files, like notebooks and the readme file may be referenced from the outside, so a copy of those is kept as well. In addition, the notebooks subdirectory of examples is also kept in contrib because the extension the build file relies on is not available in the PIP package.
PiperOrigin-RevId: 212543067
This commit is contained in:
parent
efd9e0d073
commit
668c079f4e
@ -21,11 +21,9 @@ py_library(
|
||||
],
|
||||
srcs_version = "PY2AND3",
|
||||
visibility = ["//visibility:public"],
|
||||
# This module is kept for backward compatibility only. To depend on AutoGraph,
|
||||
# use //third_party/tensorflow/python/autograph instead.
|
||||
deps = [
|
||||
"//tensorflow/contrib/autograph/impl",
|
||||
"//tensorflow/contrib/autograph/lang",
|
||||
"//tensorflow/contrib/autograph/pyct",
|
||||
"//tensorflow/contrib/autograph/utils",
|
||||
"//tensorflow/python:util",
|
||||
"//tensorflow/python/autograph",
|
||||
],
|
||||
)
|
||||
|
@ -1,5 +1,12 @@
|
||||
# AutoGraph
|
||||
|
||||
**NOTE: As tensorflow.contrib is being
|
||||
[deprecated](https://github.com/tensorflow/community/pull/18), AutoGraph is
|
||||
moving into TensorFlow core.
|
||||
|
||||
The new code location is `tensorflow/python/autograph`.
|
||||
**
|
||||
|
||||
IMPORTANT: AutoGraph is beta software, and under active development. Expect rough edges and bugs, but if you try it, we appreciate early feedback! We'd also love contributions ([please see our contributing guidelines](CONTRIBUTING.md) and our [style guide](STYLE_GUIDE.md)).
|
||||
|
||||
AutoGraph is a Python to TensorFlow compiler.
|
||||
|
@ -12,57 +12,13 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ==============================================================================
|
||||
"""Autograph compiles Python code into equivalent TensorFlow code.
|
||||
"""This is the legacy module for AutoGraph, kept for backward compatibility.
|
||||
|
||||
Equivalent here means that they have the same effect when executed.
|
||||
New users should instead use `tensorflow.python.autograph`.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
# TODO(mdan): Bring only the relevant symbols to the top level.
|
||||
from tensorflow.contrib.autograph import operators
|
||||
from tensorflow.contrib.autograph import utils
|
||||
from tensorflow.contrib.autograph.core.errors import GraphConstructionError
|
||||
from tensorflow.contrib.autograph.core.errors import TfRuntimeError
|
||||
from tensorflow.contrib.autograph.core.errors import improved_errors
|
||||
from tensorflow.contrib.autograph.impl.api import RunMode
|
||||
from tensorflow.contrib.autograph.impl.api import convert
|
||||
from tensorflow.contrib.autograph.impl.api import converted_call
|
||||
from tensorflow.contrib.autograph.impl.api import do_not_convert
|
||||
from tensorflow.contrib.autograph.impl.api import to_code
|
||||
from tensorflow.contrib.autograph.impl.api import to_graph
|
||||
from tensorflow.contrib.autograph.lang.directives import set_element_type
|
||||
from tensorflow.contrib.autograph.lang.directives import set_loop_options
|
||||
from tensorflow.contrib.autograph.lang.special_functions import stack
|
||||
from tensorflow.contrib.autograph.lang.special_functions import tensor_list
|
||||
from tensorflow.contrib.autograph.pyct.transformer import AutographParseError
|
||||
from tensorflow.python.util.all_util import remove_undocumented
|
||||
|
||||
_allowed_symbols = [
|
||||
# Main API
|
||||
'RunMode',
|
||||
'convert',
|
||||
'converted_call',
|
||||
'do_not_convert',
|
||||
'to_code',
|
||||
'to_graph',
|
||||
# Overloaded operators
|
||||
'operators',
|
||||
# Errors
|
||||
'improved_errors',
|
||||
'GraphConstructionError',
|
||||
'TfRuntimeError',
|
||||
# Python language "extensions"
|
||||
'set_element_type',
|
||||
'set_loop_options',
|
||||
'stack',
|
||||
'tensor_list',
|
||||
# Exceptions
|
||||
'AutographParseError',
|
||||
# Utilities: to be removed
|
||||
'utils',
|
||||
]
|
||||
|
||||
remove_undocumented(__name__, _allowed_symbols)
|
||||
from tensorflow.python.autograph import * # pylint:disable=wildcard-import
|
||||
|
@ -20,21 +20,18 @@ from __future__ import print_function
|
||||
|
||||
import tensorflow as tf
|
||||
|
||||
from tensorflow.contrib import autograph as ag
|
||||
from tensorflow.python.util import tf_inspect
|
||||
from tensorflow.python import autograph as ag
|
||||
|
||||
|
||||
class ErrorsTest(tf.test.TestCase):
|
||||
|
||||
def test_graph_construction_error_rewriting_call_tree(self):
|
||||
|
||||
def innermost(x):
|
||||
if x > 0:
|
||||
return tf.random_normal((2, 3), mean=0.0, dtype=tf.int32)
|
||||
return tf.zeros((2, 3))
|
||||
def test_fn():
|
||||
return tf.random_normal((2, 3), mean=0.0, dtype=tf.int32)
|
||||
|
||||
def inner_caller():
|
||||
return innermost(1.0)
|
||||
return test_fn()
|
||||
|
||||
def caller():
|
||||
return inner_caller()
|
||||
@ -45,23 +42,21 @@ class ErrorsTest(tf.test.TestCase):
|
||||
expected = error.exception
|
||||
custom_traceback = expected.custom_traceback
|
||||
found_correct_filename = False
|
||||
num_innermost_names = 0
|
||||
num_test_fn_names = 0
|
||||
num_inner_caller_names = 0
|
||||
num_caller_names = 0
|
||||
ag_output_filename = tf_inspect.getsourcefile(graph)
|
||||
for frame in custom_traceback:
|
||||
filename, _, fn_name, _ = frame
|
||||
self.assertFalse('control_flow_ops.py' in filename)
|
||||
self.assertFalse(ag_output_filename in filename)
|
||||
self.assertFalse('/tmp/' in filename)
|
||||
found_correct_filename |= __file__ in filename
|
||||
self.assertNotEqual('tf__test_fn', fn_name)
|
||||
num_innermost_names += int('innermost' == fn_name)
|
||||
num_test_fn_names += int('test_fn' == fn_name)
|
||||
self.assertNotEqual('tf__inner_caller', fn_name)
|
||||
num_inner_caller_names += int('inner_caller' == fn_name)
|
||||
self.assertNotEqual('tf__caller', fn_name)
|
||||
num_caller_names += int('caller' == fn_name)
|
||||
self.assertTrue(found_correct_filename)
|
||||
self.assertEqual(num_innermost_names, 1)
|
||||
self.assertEqual(num_test_fn_names, 1)
|
||||
self.assertEqual(num_inner_caller_names, 1)
|
||||
self.assertEqual(num_caller_names, 1)
|
||||
|
||||
@ -97,7 +92,7 @@ class ErrorsTest(tf.test.TestCase):
|
||||
compiled_fn = ag.to_graph(test_fn)
|
||||
|
||||
with self.assertRaises(ag.TfRuntimeError) as error:
|
||||
with self.cached_session() as sess:
|
||||
with self.test_session() as sess:
|
||||
x = compiled_fn(tf.constant([4, 8]))
|
||||
with ag.improved_errors(compiled_fn):
|
||||
sess.run(x)
|
||||
@ -106,19 +101,14 @@ class ErrorsTest(tf.test.TestCase):
|
||||
found_correct_filename = False
|
||||
num_test_fn_frames = 0
|
||||
num_g_frames = 0
|
||||
ag_output_filename = tf_inspect.getsourcefile(compiled_fn)
|
||||
for frame in custom_traceback:
|
||||
filename, _, fn_name, source_code = frame
|
||||
self.assertFalse(ag_output_filename in filename)
|
||||
self.assertFalse('control_flow_ops.py' in filename)
|
||||
self.assertFalse('/tmp/' in filename)
|
||||
self.assertFalse('control_flow.py' in filename)
|
||||
self.assertFalse('ag__.' in fn_name)
|
||||
self.assertFalse('tf__g' in fn_name)
|
||||
self.assertFalse('tf__test_fn' in fn_name)
|
||||
found_correct_filename |= __file__ in filename
|
||||
num_test_fn_frames += int('test_fn' == fn_name and
|
||||
'return g(x, 10)' in source_code)
|
||||
# This makes sure that the code is correctly rewritten from "x_1 //= 0" to
|
||||
# "x //= 0".
|
||||
num_g_frames += int('g' == fn_name and 'x //= 0' in source_code)
|
||||
self.assertTrue(found_correct_filename)
|
||||
self.assertEqual(num_test_fn_frames, 1)
|
||||
@ -144,7 +134,7 @@ class ErrorsTest(tf.test.TestCase):
|
||||
# frame with "g" as the function name but because we don't yet add
|
||||
# try/except blocks to inner functions the name is "tf__g".
|
||||
with self.assertRaises(ag.TfRuntimeError) as error:
|
||||
with self.cached_session() as sess:
|
||||
with self.test_session() as sess:
|
||||
x = compiled_fn(tf.constant([4, 8]))
|
||||
with ag.improved_errors(compiled_fn):
|
||||
sess.run(x)
|
@ -20,7 +20,7 @@ from __future__ import print_function
|
||||
|
||||
import tensorflow as tf
|
||||
|
||||
from tensorflow.contrib import autograph
|
||||
from tensorflow.python import autograph
|
||||
|
||||
|
||||
class MinimalKeras(tf.keras.Model):
|
@ -20,7 +20,7 @@ from __future__ import print_function
|
||||
|
||||
import tensorflow as tf
|
||||
|
||||
from tensorflow.contrib import autograph as ag
|
||||
from tensorflow.python import autograph as ag
|
||||
|
||||
|
||||
def list_used_as_tuple():
|
31
tensorflow/python/autograph/BUILD
Normal file
31
tensorflow/python/autograph/BUILD
Normal file
@ -0,0 +1,31 @@
|
||||
licenses(["notice"]) # Apache 2.0
|
||||
|
||||
load("//tensorflow:tensorflow.bzl", "py_test")
|
||||
|
||||
filegroup(
|
||||
name = "all_files",
|
||||
srcs = glob(
|
||||
["**/*"],
|
||||
exclude = [
|
||||
"**/METADATA",
|
||||
"**/OWNERS",
|
||||
],
|
||||
),
|
||||
visibility = ["//tensorflow:__subpackages__"],
|
||||
)
|
||||
|
||||
py_library(
|
||||
name = "autograph",
|
||||
srcs = [
|
||||
"__init__.py",
|
||||
],
|
||||
srcs_version = "PY2AND3",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//tensorflow/python:util",
|
||||
"//tensorflow/python/autograph/impl",
|
||||
"//tensorflow/python/autograph/lang",
|
||||
"//tensorflow/python/autograph/pyct",
|
||||
"//tensorflow/python/autograph/utils",
|
||||
],
|
||||
)
|
@ -2,6 +2,15 @@
|
||||
|
||||
We'd love to have your patches and contributions! Here are some guidelines. In general, we follow the [TensorFlow contributing guidelines](../../CONTRIBUTING.md), but have some [AutoGraph-specific style guidelines](STYLE_GUIDE.md). More details below.
|
||||
|
||||
### Note to active contributors
|
||||
|
||||
In preparation for TF 2.0, we moved the code base of AutoGraph from
|
||||
`tensorflow/contrib/autograph` to `tensorflow/python/autograph`. The move
|
||||
does not impact functionality, and AutoGraph will remain accessible under
|
||||
`tensorflow.contrib.autograph` until `tensorflow.contrib` is retired.
|
||||
|
||||
When
|
||||
|
||||
## TensorFlow Code of Conduct
|
||||
Please review and follow the [TensorFlow Code of Conduct](../../CODE_OF_CONDUCT.md).
|
||||
|
143
tensorflow/python/autograph/README.md
Normal file
143
tensorflow/python/autograph/README.md
Normal file
@ -0,0 +1,143 @@
|
||||
# AutoGraph
|
||||
|
||||
IMPORTANT: AutoGraph is beta software, and under active development. Expect rough edges and bugs, but if you try it, we appreciate early feedback! We'd also love contributions ([please see our contributing guidelines](CONTRIBUTING.md) and our [style guide](STYLE_GUIDE.md)).
|
||||
|
||||
AutoGraph is a Python to TensorFlow compiler.
|
||||
|
||||
With AutoGraph, you can write [Eager style](https://www.tensorflow.org/guide/eager) code in a concise manner, and run it as a TensorFlow graph. AutoGraph uses source code transformation and partial evaluation to generate Python code that builds an equivalent TensorFlow subgraph. The result is code that behaves like ops and can be freely combined with other TensorFlow ops. [Please see this file for which parts of the Python language we currently support](LIMITATIONS.md).
|
||||
|
||||
For example, this Python function:
|
||||
|
||||
```
|
||||
def f(x):
|
||||
if x < 0:
|
||||
x = -x
|
||||
return x
|
||||
```
|
||||
|
||||
would be converted to this:
|
||||
|
||||
```
|
||||
def graph_mode_f(x):
|
||||
with tf.name_scope('f'):
|
||||
|
||||
def if_true():
|
||||
with tf.name_scope('if_true'):
|
||||
x_1, = x,
|
||||
x_1 = tf.negative(x_1)
|
||||
return x_1,
|
||||
|
||||
def if_false():
|
||||
with tf.name_scope('if_false'):
|
||||
x_1, = x,
|
||||
return x_1,
|
||||
x = ag__.utils.run_cond(tf.greater(x, 0), if_true, if_false)
|
||||
return x
|
||||
```
|
||||
|
||||
so you can use it like an op:
|
||||
|
||||
```
|
||||
with tf.Graph().as_default():
|
||||
x = tf.constant(-1.0)
|
||||
|
||||
converted_f = autograph.to_graph(f)
|
||||
y = converted_f(x)
|
||||
|
||||
with tf.Session() as sess:
|
||||
print(sess.run(y))
|
||||
# Output: 1
|
||||
```
|
||||
|
||||
# Getting started
|
||||
|
||||
Use AutoGraph in one of the following ways, described below:
|
||||
|
||||
1. Annotations (simpler)
|
||||
2. Functional API (more flexible)
|
||||
|
||||
To get started, install the latest nightly TensorFlow build:
|
||||
|
||||
```shell
|
||||
pip install -U tf-nightly
|
||||
```
|
||||
|
||||
Then import the `autograph` module from `tf.contrib`:
|
||||
|
||||
```
|
||||
from tensorflow.contrib import autograph as ag
|
||||
```
|
||||
|
||||
### Related links
|
||||
|
||||
Articles:
|
||||
|
||||
* [TensorFlow blog post](https://medium.com/tensorflow/autograph-converts-python-into-tensorflow-graphs-b2a871f87ec7)
|
||||
|
||||
Interactive notebooks:
|
||||
|
||||
* [Quick guide](https://colab.research.google.com/github/tensorflow/models/blob/master/samples/core/guide/autograph.ipynb)
|
||||
* [RNN trained using Keras and Estimators](https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/contrib/autograph/examples/notebooks/rnn_keras_estimator.ipynb)
|
||||
* [Demo from the TF Dev Summit 2018](https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/contrib/autograph/examples/notebooks/dev_summit_2018_demo.ipynb)
|
||||
* [Basic control flow speed test](https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/contrib/autograph/examples/notebooks/ag_vs_eager_collatz_speed_test.ipynb)
|
||||
* [MNIST training speed test](https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/contrib/autograph/examples/notebooks/ag_vs_eager_mnist_speed_test.ipynb)
|
||||
* [Basic algorithm samples](https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/contrib/autograph/examples/notebooks/algorithms.ipynb)
|
||||
* [Introductory workshop support notebook](https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/contrib/autograph/examples/notebooks/workshop.ipynb)
|
||||
|
||||
## Using with annotations
|
||||
|
||||
Annotating a function or class with `@convert` converts it in place:
|
||||
|
||||
```
|
||||
@ag.convert()
|
||||
def f(x):
|
||||
if x < 0:
|
||||
x = -x
|
||||
return x
|
||||
```
|
||||
|
||||
... so that it always outputs TensorFlow code:
|
||||
|
||||
```
|
||||
with tf.Graph().as_default():
|
||||
x = tf.constant(-1)
|
||||
|
||||
y = f(x)
|
||||
|
||||
with tf.Session() as sess:
|
||||
print(sess.run(y))
|
||||
# Output: 1
|
||||
```
|
||||
|
||||
## Using the functional API
|
||||
|
||||
The functional API allows you to convert an existing function, class or object after it was defined:
|
||||
|
||||
```
|
||||
converted_f = ag.to_graph(f)
|
||||
|
||||
print(converted_f(tf.constant(-1)))
|
||||
# Output: Tensor
|
||||
|
||||
print(f(-1))
|
||||
# Output: 1
|
||||
```
|
||||
|
||||
You can use the functional API to inspect the generated code as well:
|
||||
|
||||
```
|
||||
print(ag.to_code(f))
|
||||
# Output: <Python and TensorFlow code>
|
||||
```
|
||||
|
||||
## Filing bugs and feature requests
|
||||
|
||||
### Reporting a bug
|
||||
|
||||
- If AutoGraph-generated code is compiling and running, but producing an incorrect result, send us a minimal reproduction case that includes the original Eager code, the inputs and if possible, the outputs or the error message.
|
||||
- If AutoGraph-generated code is compiling, but not running, send us a minimal reproduction case that includes the original Eager code, the inputs and if possible, the outputs or the error message.
|
||||
- If AutoGraph-generated code is not compiling, send us two minimal pieces of code. First, the Eager code that you would like to write, and second, the Graph code that you would like AutoGraph to have generated for you.
|
||||
|
||||
### Requesting a feature
|
||||
|
||||
If you’d like AutoGraph to convert a feature of Python or TF that we currently don’t handle, please let us know by filing a bug. We’ll make it as easy as possible to interact with us through there.
|
68
tensorflow/python/autograph/__init__.py
Normal file
68
tensorflow/python/autograph/__init__.py
Normal file
@ -0,0 +1,68 @@
|
||||
# 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.
|
||||
# ==============================================================================
|
||||
"""Autograph compiles Python code into equivalent TensorFlow code.
|
||||
|
||||
Equivalent here means that they have the same effect when executed.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
# TODO(mdan): Bring only the relevant symbols to the top level.
|
||||
from tensorflow.python.autograph import operators
|
||||
from tensorflow.python.autograph import utils
|
||||
from tensorflow.python.autograph.core.errors import GraphConstructionError
|
||||
from tensorflow.python.autograph.core.errors import TfRuntimeError
|
||||
from tensorflow.python.autograph.core.errors import improved_errors
|
||||
from tensorflow.python.autograph.impl.api import RunMode
|
||||
from tensorflow.python.autograph.impl.api import convert
|
||||
from tensorflow.python.autograph.impl.api import converted_call
|
||||
from tensorflow.python.autograph.impl.api import do_not_convert
|
||||
from tensorflow.python.autograph.impl.api import to_code
|
||||
from tensorflow.python.autograph.impl.api import to_graph
|
||||
from tensorflow.python.autograph.lang.directives import set_element_type
|
||||
from tensorflow.python.autograph.lang.directives import set_loop_options
|
||||
from tensorflow.python.autograph.lang.special_functions import stack
|
||||
from tensorflow.python.autograph.lang.special_functions import tensor_list
|
||||
from tensorflow.python.autograph.pyct.transformer import AutographParseError
|
||||
from tensorflow.python.util.all_util import remove_undocumented
|
||||
|
||||
_allowed_symbols = [
|
||||
# Main API
|
||||
'RunMode',
|
||||
'convert',
|
||||
'converted_call',
|
||||
'do_not_convert',
|
||||
'to_code',
|
||||
'to_graph',
|
||||
# Overloaded operators
|
||||
'operators',
|
||||
# Errors
|
||||
'improved_errors',
|
||||
'GraphConstructionError',
|
||||
'TfRuntimeError',
|
||||
# Python language "extensions"
|
||||
'set_element_type',
|
||||
'set_loop_options',
|
||||
'stack',
|
||||
'tensor_list',
|
||||
# Exceptions
|
||||
'AutographParseError',
|
||||
# Utilities: to be removed
|
||||
'utils',
|
||||
]
|
||||
|
||||
remove_undocumented(__name__, _allowed_symbols)
|
@ -38,11 +38,11 @@ py_library(
|
||||
srcs_version = "PY2AND3",
|
||||
visibility = ["//tensorflow:__subpackages__"],
|
||||
deps = [
|
||||
"//tensorflow/contrib/autograph/core",
|
||||
"//tensorflow/contrib/autograph/lang",
|
||||
"//tensorflow/contrib/autograph/pyct",
|
||||
"//tensorflow/contrib/autograph/pyct/static_analysis",
|
||||
"//tensorflow/python:util",
|
||||
"//tensorflow/python/autograph/core",
|
||||
"//tensorflow/python/autograph/lang",
|
||||
"//tensorflow/python/autograph/pyct",
|
||||
"//tensorflow/python/autograph/pyct/static_analysis",
|
||||
"@gast_archive//:gast",
|
||||
],
|
||||
)
|
||||
@ -54,8 +54,8 @@ py_test(
|
||||
tags = ["no_windows"],
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
],
|
||||
)
|
||||
|
||||
@ -65,8 +65,8 @@ py_test(
|
||||
srcs_version = "PY2AND3",
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
],
|
||||
)
|
||||
|
||||
@ -77,8 +77,8 @@ py_test(
|
||||
tags = ["no_windows"],
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
],
|
||||
)
|
||||
|
||||
@ -90,9 +90,9 @@ py_test(
|
||||
tags = ["no_windows"],
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/contrib/autograph/impl",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
"//tensorflow/python/autograph/impl",
|
||||
],
|
||||
)
|
||||
|
||||
@ -102,8 +102,8 @@ py_test(
|
||||
srcs_version = "PY2AND3",
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
],
|
||||
)
|
||||
|
||||
@ -113,8 +113,8 @@ py_test(
|
||||
srcs_version = "PY2AND3",
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
],
|
||||
)
|
||||
|
||||
@ -124,8 +124,8 @@ py_test(
|
||||
srcs_version = "PY2AND3",
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
],
|
||||
)
|
||||
|
||||
@ -139,8 +139,8 @@ py_test(
|
||||
],
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
],
|
||||
)
|
||||
|
||||
@ -150,9 +150,9 @@ py_test(
|
||||
srcs_version = "PY2AND3",
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/contrib/autograph/lang",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
"//tensorflow/python/autograph/lang",
|
||||
],
|
||||
)
|
||||
|
||||
@ -161,9 +161,9 @@ py_test(
|
||||
srcs = ["name_scopes_test.py"],
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/contrib/autograph/pyct",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
"//tensorflow/python/autograph/pyct",
|
||||
],
|
||||
)
|
||||
|
||||
@ -173,8 +173,8 @@ py_test(
|
||||
srcs_version = "PY2AND3",
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
],
|
||||
)
|
||||
|
||||
@ -184,8 +184,8 @@ py_test(
|
||||
srcs_version = "PY2AND3",
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
],
|
||||
)
|
||||
|
||||
@ -195,8 +195,8 @@ py_test(
|
||||
srcs_version = "PY2AND3",
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
],
|
||||
)
|
||||
|
||||
@ -207,8 +207,8 @@ py_test(
|
||||
tags = ["notsan"],
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
],
|
||||
)
|
||||
|
||||
@ -218,9 +218,9 @@ py_test(
|
||||
srcs_version = "PY2AND3",
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/contrib/autograph/pyct",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
"//tensorflow/python/autograph/pyct",
|
||||
],
|
||||
)
|
||||
|
||||
@ -230,9 +230,9 @@ py_test(
|
||||
srcs_version = "PY2AND3",
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/contrib/autograph/pyct",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
"//tensorflow/python/autograph/pyct",
|
||||
],
|
||||
)
|
||||
|
||||
@ -242,8 +242,8 @@ py_test(
|
||||
srcs_version = "PY2AND3",
|
||||
deps = [
|
||||
":converters",
|
||||
"//tensorflow/contrib/autograph/core:test_lib",
|
||||
"//tensorflow/contrib/autograph/pyct",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/core:test_lib",
|
||||
"//tensorflow/python/autograph/pyct",
|
||||
],
|
||||
)
|
@ -20,8 +20,8 @@ from __future__ import print_function
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
|
||||
|
||||
class AssertTransformer(converter.Base):
|
@ -20,8 +20,8 @@ from __future__ import print_function
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.converters import asserts
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.converters import asserts
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -18,10 +18,10 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.contrib.autograph.pyct.static_analysis.annos import NodeAnno
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.pyct.static_analysis.annos import NodeAnno
|
||||
|
||||
|
||||
class _Break(object):
|
@ -18,8 +18,8 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.converters import break_statements
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.converters import break_statements
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.eager import context as tfe_ctx
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.platform import test
|
@ -20,10 +20,10 @@ from __future__ import print_function
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.operators import py_builtins
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.operators import py_builtins
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
|
||||
|
||||
class BuiltinFunctionTransformer(converter.Base):
|
@ -20,8 +20,8 @@ from __future__ import print_function
|
||||
|
||||
import six
|
||||
|
||||
from tensorflow.contrib.autograph.converters import builtin_functions
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.converters import builtin_functions
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.ops import array_ops
|
@ -26,12 +26,12 @@ from collections import namedtuple
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import ast_util
|
||||
from tensorflow.contrib.autograph.pyct import inspect_utils
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import ast_util
|
||||
from tensorflow.python.autograph.pyct import inspect_utils
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
from tensorflow.python.util import tf_inspect
|
||||
|
||||
|
@ -20,8 +20,8 @@ from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
|
||||
from tensorflow.contrib.autograph.converters import call_trees
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.converters import call_trees
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import ops
|
@ -18,10 +18,10 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.contrib.autograph.pyct.static_analysis.annos import NodeAnno
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.pyct.static_analysis.annos import NodeAnno
|
||||
|
||||
|
||||
class _FunctionDefs(object):
|
@ -18,8 +18,8 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.converters import conditional_expressions
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.converters import conditional_expressions
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -18,10 +18,10 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.contrib.autograph.pyct.static_analysis.annos import NodeAnno
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.pyct.static_analysis.annos import NodeAnno
|
||||
|
||||
|
||||
# Tags for local state.
|
@ -18,8 +18,8 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.converters import continue_statements
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.converters import continue_statements
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.eager import context as tfe_ctx
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.platform import test
|
@ -20,12 +20,12 @@ from __future__ import print_function
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import ast_util
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.contrib.autograph.pyct.static_analysis import annos
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import ast_util
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.pyct.static_analysis import annos
|
||||
|
||||
|
||||
class SymbolNamer(object):
|
@ -18,9 +18,9 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.converters import control_flow
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.contrib.autograph.pyct import transformer
|
||||
from tensorflow.python.autograph.converters import control_flow
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.pyct import transformer
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.platform import test
|
@ -24,8 +24,8 @@ from __future__ import print_function
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.util import tf_inspect
|
||||
|
||||
|
@ -19,11 +19,13 @@ from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from functools import wraps
|
||||
import imp
|
||||
|
||||
from tensorflow.contrib.autograph.converters import decorators
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.contrib.autograph.pyct import compiler
|
||||
from tensorflow.contrib.autograph.pyct import transformer
|
||||
from tensorflow.python import autograph
|
||||
from tensorflow.python.autograph.converters import decorators
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.pyct import compiler
|
||||
from tensorflow.python.autograph.pyct import transformer
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
||||
@ -136,6 +138,12 @@ class DecoratorsTest(converter_testing.TestCase):
|
||||
|
||||
return inner_fn(a)
|
||||
|
||||
# Work around TensorFlow's symbol suppression mechanism that causes core to
|
||||
# be invisible in the generated code.
|
||||
core_mod = imp.new_module('core')
|
||||
core_mod.converter_testing = converter_testing
|
||||
autograph.core = core_mod
|
||||
|
||||
# 14 = 1 (a) + 1 (simple_decorator) + 11 (inner_fn)
|
||||
self.assertEqual(14, test_fn(1))
|
||||
|
@ -25,9 +25,9 @@ from __future__ import print_function
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.lang import directives
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.lang import directives
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.util import tf_inspect
|
||||
|
||||
ENCLOSING_LOOP = 'enclosing_loop'
|
@ -18,12 +18,12 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.converters import directives as directives_converter
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.contrib.autograph.core.converter import AgAnno
|
||||
from tensorflow.contrib.autograph.lang import directives
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.converters import directives as directives_converter
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.core.converter import AgAnno
|
||||
from tensorflow.python.autograph.lang import directives
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -22,9 +22,9 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
|
||||
|
||||
class ErrorRewritingTransformer(converter.Base):
|
@ -18,11 +18,11 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.converters import error_handlers
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.contrib.autograph.core import errors
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import origin_info
|
||||
from tensorflow.python.autograph.converters import error_handlers
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.core import errors
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import origin_info
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -32,8 +32,8 @@ from __future__ import print_function
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
|
||||
|
||||
# TODO(mdan): This should covert directly to operator calls.
|
@ -18,8 +18,8 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.converters import list_comprehensions
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.converters import list_comprehensions
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -32,12 +32,12 @@ from __future__ import print_function
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.lang import directives
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.contrib.autograph.pyct.static_analysis.annos import NodeAnno
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.lang import directives
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.pyct.static_analysis.annos import NodeAnno
|
||||
|
||||
|
||||
# Tags for local state.
|
@ -18,12 +18,12 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.converters import lists
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.contrib.autograph.lang import directives
|
||||
from tensorflow.contrib.autograph.lang import special_functions
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.converters import lists
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.lang import directives
|
||||
from tensorflow.python.autograph.lang import special_functions
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import ops
|
||||
from tensorflow.python.ops import array_ops
|
@ -23,10 +23,10 @@ from __future__ import print_function
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
|
||||
|
||||
# TODO(mdan): Properly extrack boolean ops according to lazy eval rules.
|
@ -18,8 +18,8 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.converters import logical_expressions
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.converters import logical_expressions
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.ops import math_ops
|
||||
from tensorflow.python.platform import test
|
||||
|
@ -20,8 +20,8 @@ from __future__ import print_function
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
|
||||
|
||||
class FunctionNameScopeTransformer(converter.Base):
|
@ -18,8 +18,8 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.converters import name_scopes
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.converters import name_scopes
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import ops
|
||||
from tensorflow.python.platform import test
|
@ -20,11 +20,11 @@ from __future__ import print_function
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import ast_util
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.contrib.autograph.pyct.static_analysis.annos import NodeAnno
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import ast_util
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.pyct.static_analysis.annos import NodeAnno
|
||||
|
||||
|
||||
# TODO(mdan): Move this logic into transformer_base.
|
@ -18,8 +18,8 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.converters import return_statements
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.converters import return_statements
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.framework import ops
|
||||
from tensorflow.python.platform import test
|
||||
|
@ -36,12 +36,12 @@ from __future__ import print_function
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import ast_util
|
||||
from tensorflow.contrib.autograph.pyct import qual_names
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.contrib.autograph.pyct.static_analysis.annos import NodeAnno
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import ast_util
|
||||
from tensorflow.python.autograph.pyct import qual_names
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.pyct.static_analysis.annos import NodeAnno
|
||||
|
||||
|
||||
class SymbolNamer(object):
|
@ -18,8 +18,8 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.converters import side_effect_guards
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.converters import side_effect_guards
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import errors_impl
|
||||
from tensorflow.python.framework import ops
|
@ -20,9 +20,9 @@ from __future__ import print_function
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.lang import directives
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.lang import directives
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
|
||||
|
||||
class SliceTransformer(converter.Base):
|
@ -18,12 +18,12 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.converters import slices
|
||||
from tensorflow.contrib.autograph.core import converter_testing
|
||||
from tensorflow.contrib.autograph.lang import directives
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.contrib.autograph.pyct import transformer
|
||||
from tensorflow.python.autograph.converters import slices
|
||||
from tensorflow.python.autograph.core import converter_testing
|
||||
from tensorflow.python.autograph.lang import directives
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import transformer
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.ops import list_ops
|
@ -25,9 +25,9 @@ py_library(
|
||||
srcs_version = "PY2AND3",
|
||||
visibility = ["//tensorflow:__subpackages__"],
|
||||
deps = [
|
||||
"//tensorflow/contrib/autograph/pyct",
|
||||
"//tensorflow/contrib/autograph/pyct/static_analysis",
|
||||
"//tensorflow/contrib/autograph/utils",
|
||||
"//tensorflow/python/autograph/pyct",
|
||||
"//tensorflow/python/autograph/pyct/static_analysis",
|
||||
"//tensorflow/python/autograph/utils",
|
||||
],
|
||||
)
|
||||
|
||||
@ -65,10 +65,10 @@ py_library(
|
||||
visibility = ["//tensorflow:__subpackages__"],
|
||||
deps = [
|
||||
":core",
|
||||
"//tensorflow/contrib/autograph/operators",
|
||||
"//tensorflow/contrib/autograph/pyct",
|
||||
"//tensorflow/contrib/autograph/pyct/static_analysis",
|
||||
"//tensorflow/contrib/autograph/utils",
|
||||
"//tensorflow/python/autograph/operators",
|
||||
"//tensorflow/python/autograph/pyct",
|
||||
"//tensorflow/python/autograph/pyct/static_analysis",
|
||||
"//tensorflow/python/autograph/utils",
|
||||
"@gast_archive//:gast",
|
||||
"@six_archive//:six",
|
||||
],
|
@ -18,7 +18,7 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph import utils
|
||||
from tensorflow.python.autograph import utils
|
||||
|
||||
|
||||
PYTHON_LITERALS = {
|
||||
@ -36,7 +36,7 @@ DEFAULT_UNCOMPILED_MODULES = set((
|
||||
# have well-known names. Not referring to the module directly to avoid
|
||||
# circular imports.
|
||||
(
|
||||
utils.__name__[:-len('.contrib.autograph.utils')],),
|
||||
utils.__name__[:-len('.python.autograph.utils')],),
|
||||
))
|
||||
|
||||
NO_SIDE_EFFECT_CONSTRUCTORS = set(('tensorflow',))
|
@ -67,19 +67,19 @@ import collections
|
||||
from enum import Enum
|
||||
|
||||
|
||||
from tensorflow.contrib.autograph.core import config
|
||||
from tensorflow.contrib.autograph.core import naming
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import ast_util
|
||||
from tensorflow.contrib.autograph.pyct import cfg
|
||||
from tensorflow.contrib.autograph.pyct import compiler
|
||||
from tensorflow.contrib.autograph.pyct import qual_names
|
||||
from tensorflow.contrib.autograph.pyct import transformer
|
||||
from tensorflow.contrib.autograph.pyct.static_analysis import activity
|
||||
from tensorflow.contrib.autograph.pyct.static_analysis import live_values
|
||||
from tensorflow.contrib.autograph.pyct.static_analysis import liveness
|
||||
from tensorflow.contrib.autograph.pyct.static_analysis import reaching_definitions
|
||||
from tensorflow.contrib.autograph.pyct.static_analysis import type_info
|
||||
from tensorflow.python.autograph.core import config
|
||||
from tensorflow.python.autograph.core import naming
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import ast_util
|
||||
from tensorflow.python.autograph.pyct import cfg
|
||||
from tensorflow.python.autograph.pyct import compiler
|
||||
from tensorflow.python.autograph.pyct import qual_names
|
||||
from tensorflow.python.autograph.pyct import transformer
|
||||
from tensorflow.python.autograph.pyct.static_analysis import activity
|
||||
from tensorflow.python.autograph.pyct.static_analysis import live_values
|
||||
from tensorflow.python.autograph.pyct.static_analysis import liveness
|
||||
from tensorflow.python.autograph.pyct.static_analysis import reaching_definitions
|
||||
from tensorflow.python.autograph.pyct.static_analysis import type_info
|
||||
|
||||
# TODO(mdan): These contexts can be refactored into first class objects.
|
||||
# For example, we could define Program and Entity abstractions that hold on
|
@ -24,15 +24,15 @@ import sys
|
||||
|
||||
import six
|
||||
|
||||
from tensorflow.contrib.autograph import operators
|
||||
from tensorflow.contrib.autograph import utils
|
||||
from tensorflow.contrib.autograph.core import config
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.core import errors
|
||||
from tensorflow.contrib.autograph.pyct import compiler
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.contrib.autograph.pyct import pretty_printer
|
||||
from tensorflow.contrib.autograph.pyct import transformer
|
||||
from tensorflow.python.autograph import operators
|
||||
from tensorflow.python.autograph import utils
|
||||
from tensorflow.python.autograph.core import config
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.core import errors
|
||||
from tensorflow.python.autograph.pyct import compiler
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import pretty_printer
|
||||
from tensorflow.python.autograph.pyct import transformer
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -31,7 +31,7 @@ import logging
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import origin_info
|
||||
from tensorflow.python.autograph.pyct import origin_info
|
||||
from tensorflow.python.framework import errors_impl
|
||||
|
||||
# TODO(mdan): Add a superclass common to all errors.
|
@ -18,8 +18,8 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.core import errors
|
||||
from tensorflow.contrib.autograph.pyct import origin_info
|
||||
from tensorflow.python.autograph.core import errors
|
||||
from tensorflow.python.autograph.pyct import origin_info
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import errors as tf_errors
|
||||
from tensorflow.python.ops import array_ops
|
@ -18,7 +18,7 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import qual_names
|
||||
from tensorflow.python.autograph.pyct import qual_names
|
||||
|
||||
|
||||
class Namer(object):
|
@ -18,7 +18,7 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.core import naming
|
||||
from tensorflow.python.autograph.core import naming
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -23,14 +23,14 @@ py_library(
|
||||
srcs_version = "PY2AND3",
|
||||
visibility = ["//tensorflow:__subpackages__"],
|
||||
deps = [
|
||||
"//tensorflow/contrib/autograph/converters",
|
||||
"//tensorflow/contrib/autograph/core",
|
||||
"//tensorflow/contrib/autograph/operators",
|
||||
"//tensorflow/contrib/autograph/pyct",
|
||||
"//tensorflow/contrib/autograph/pyct/static_analysis",
|
||||
"//tensorflow/contrib/autograph/utils",
|
||||
"//tensorflow/python:platform",
|
||||
"//tensorflow/python:util",
|
||||
"//tensorflow/python/autograph/converters",
|
||||
"//tensorflow/python/autograph/core",
|
||||
"//tensorflow/python/autograph/operators",
|
||||
"//tensorflow/python/autograph/pyct",
|
||||
"//tensorflow/python/autograph/pyct/static_analysis",
|
||||
"//tensorflow/python/autograph/utils",
|
||||
"@gast_archive//:gast",
|
||||
"@six_archive//:six",
|
||||
],
|
||||
@ -43,8 +43,8 @@ py_test(
|
||||
tags = ["no_windows"],
|
||||
deps = [
|
||||
":impl",
|
||||
"//tensorflow/contrib/autograph/utils",
|
||||
"//tensorflow/python:client_testlib",
|
||||
"//tensorflow/python/autograph/utils",
|
||||
"//third_party/py/numpy",
|
||||
],
|
||||
)
|
@ -22,17 +22,13 @@ from functools import wraps
|
||||
|
||||
from enum import Enum
|
||||
|
||||
# pylint:disable=g-bad-import-order
|
||||
import six
|
||||
# pylint:enable=g-bad-import-order
|
||||
|
||||
from tensorflow.contrib.autograph.core import config
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.impl import conversion
|
||||
from tensorflow.contrib.autograph.operators import py_builtins
|
||||
from tensorflow.contrib.autograph.pyct import compiler
|
||||
from tensorflow.contrib.autograph.pyct import inspect_utils
|
||||
from tensorflow.contrib.autograph.utils import py_func
|
||||
from tensorflow.python.autograph.core import config
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.impl import conversion
|
||||
from tensorflow.python.autograph.operators import py_builtins
|
||||
from tensorflow.python.autograph.pyct import compiler
|
||||
from tensorflow.python.autograph.pyct import inspect_utils
|
||||
from tensorflow.python.autograph.utils import py_func
|
||||
from tensorflow.python.platform import tf_logging as logging
|
||||
from tensorflow.python.util import tf_decorator
|
||||
from tensorflow.python.util import tf_inspect
|
||||
@ -257,7 +253,7 @@ def to_graph(e,
|
||||
arg_types)
|
||||
|
||||
nodes = []
|
||||
for dep in reversed(program_ctx.dependency_cache.values()):
|
||||
for dep in reversed(tuple(program_ctx.dependency_cache.values())):
|
||||
nodes.extend(dep)
|
||||
compiled_module, compiled_src = compiler.ast_to_object(
|
||||
nodes,
|
||||
@ -327,6 +323,6 @@ def to_code(e,
|
||||
|
||||
code = '\n'.join(
|
||||
compiler.ast_to_source(dep, indentation)
|
||||
for dep in reversed(tuple(six.itervalues(program_ctx.dependency_cache))))
|
||||
for dep in reversed(tuple(program_ctx.dependency_cache.values())))
|
||||
|
||||
return program_ctx.required_imports + '\n\n' + code
|
@ -20,11 +20,11 @@ from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
|
||||
from tensorflow.contrib.autograph import utils
|
||||
from tensorflow.contrib.autograph.core import config
|
||||
from tensorflow.contrib.autograph.impl import api
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.contrib.autograph.utils import py_func
|
||||
from tensorflow.python.autograph import utils
|
||||
from tensorflow.python.autograph.core import config
|
||||
from tensorflow.python.autograph.impl import api
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.utils import py_func
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.platform import test
|
||||
from tensorflow.python.util import tf_inspect
|
@ -22,34 +22,34 @@ import imp
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph import operators
|
||||
from tensorflow.contrib.autograph import utils
|
||||
from tensorflow.contrib.autograph.converters import asserts
|
||||
from tensorflow.contrib.autograph.converters import break_statements
|
||||
from tensorflow.contrib.autograph.converters import builtin_functions
|
||||
from tensorflow.contrib.autograph.converters import call_trees
|
||||
from tensorflow.contrib.autograph.converters import conditional_expressions
|
||||
from tensorflow.contrib.autograph.converters import continue_statements
|
||||
from tensorflow.contrib.autograph.converters import control_flow
|
||||
from tensorflow.contrib.autograph.converters import decorators
|
||||
from tensorflow.contrib.autograph.converters import directives
|
||||
from tensorflow.contrib.autograph.converters import error_handlers
|
||||
from tensorflow.contrib.autograph.converters import lists
|
||||
from tensorflow.contrib.autograph.converters import logical_expressions
|
||||
from tensorflow.contrib.autograph.converters import name_scopes
|
||||
from tensorflow.contrib.autograph.converters import return_statements
|
||||
from tensorflow.contrib.autograph.converters import side_effect_guards
|
||||
from tensorflow.contrib.autograph.converters import slices
|
||||
from tensorflow.contrib.autograph.core import config
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.core import errors
|
||||
from tensorflow.contrib.autograph.pyct import ast_util
|
||||
from tensorflow.contrib.autograph.pyct import inspect_utils
|
||||
from tensorflow.contrib.autograph.pyct import origin_info
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.contrib.autograph.pyct import qual_names
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.contrib.autograph.pyct import transformer
|
||||
from tensorflow.python.autograph import operators
|
||||
from tensorflow.python.autograph import utils
|
||||
from tensorflow.python.autograph.converters import asserts
|
||||
from tensorflow.python.autograph.converters import break_statements
|
||||
from tensorflow.python.autograph.converters import builtin_functions
|
||||
from tensorflow.python.autograph.converters import call_trees
|
||||
from tensorflow.python.autograph.converters import conditional_expressions
|
||||
from tensorflow.python.autograph.converters import continue_statements
|
||||
from tensorflow.python.autograph.converters import control_flow
|
||||
from tensorflow.python.autograph.converters import decorators
|
||||
from tensorflow.python.autograph.converters import directives
|
||||
from tensorflow.python.autograph.converters import error_handlers
|
||||
from tensorflow.python.autograph.converters import lists
|
||||
from tensorflow.python.autograph.converters import logical_expressions
|
||||
from tensorflow.python.autograph.converters import name_scopes
|
||||
from tensorflow.python.autograph.converters import return_statements
|
||||
from tensorflow.python.autograph.converters import side_effect_guards
|
||||
from tensorflow.python.autograph.converters import slices
|
||||
from tensorflow.python.autograph.core import config
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.core import errors
|
||||
from tensorflow.python.autograph.pyct import ast_util
|
||||
from tensorflow.python.autograph.pyct import inspect_utils
|
||||
from tensorflow.python.autograph.pyct import origin_info
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import qual_names
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.pyct import transformer
|
||||
from tensorflow.python.util import tf_inspect
|
||||
|
||||
|
@ -20,11 +20,11 @@ from __future__ import print_function
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph import utils
|
||||
from tensorflow.contrib.autograph.core import config
|
||||
from tensorflow.contrib.autograph.core import converter
|
||||
from tensorflow.contrib.autograph.impl import api
|
||||
from tensorflow.contrib.autograph.impl import conversion
|
||||
from tensorflow.python.autograph import utils
|
||||
from tensorflow.python.autograph.core import config
|
||||
from tensorflow.python.autograph.core import converter
|
||||
from tensorflow.python.autograph.impl import api
|
||||
from tensorflow.python.autograph.impl import conversion
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.keras.engine import training
|
||||
from tensorflow.python.platform import test
|
@ -25,7 +25,7 @@ py_library(
|
||||
srcs_version = "PY2AND3",
|
||||
visibility = ["//tensorflow:__subpackages__"],
|
||||
deps = [
|
||||
"//tensorflow/contrib/autograph/operators",
|
||||
"//tensorflow/python/autograph/operators",
|
||||
],
|
||||
)
|
||||
|
@ -23,7 +23,7 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.operators import data_structures
|
||||
from tensorflow.python.autograph.operators import data_structures
|
||||
|
||||
|
||||
def tensor_list(elements,
|
@ -18,7 +18,7 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.lang import special_functions
|
||||
from tensorflow.python.autograph.lang import special_functions
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import tensor_util
|
@ -28,7 +28,6 @@ py_library(
|
||||
srcs_version = "PY2AND3",
|
||||
visibility = ["//tensorflow:__subpackages__"],
|
||||
deps = [
|
||||
"//tensorflow/contrib/autograph/utils",
|
||||
"//tensorflow/python:array_ops",
|
||||
"//tensorflow/python:constant_op",
|
||||
"//tensorflow/python:control_flow_ops",
|
||||
@ -38,6 +37,7 @@ py_library(
|
||||
"//tensorflow/python:tensor_array_ops",
|
||||
"//tensorflow/python:tensor_util",
|
||||
"//tensorflow/python:variables",
|
||||
"//tensorflow/python/autograph/utils",
|
||||
"//tensorflow/python/data/ops:dataset_ops",
|
||||
],
|
||||
)
|
||||
@ -66,6 +66,7 @@ py_test(
|
||||
name = "py_builtins_test",
|
||||
srcs = ["py_builtins_test.py"],
|
||||
srcs_version = "PY2AND3",
|
||||
tags = ["no_windows"],
|
||||
deps = [
|
||||
":operators",
|
||||
"//tensorflow/python:client_testlib",
|
@ -37,19 +37,19 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.operators.control_flow import for_stmt
|
||||
from tensorflow.contrib.autograph.operators.control_flow import while_stmt
|
||||
from tensorflow.contrib.autograph.operators.data_structures import list_append
|
||||
from tensorflow.contrib.autograph.operators.data_structures import list_pop
|
||||
from tensorflow.contrib.autograph.operators.data_structures import list_stack
|
||||
from tensorflow.contrib.autograph.operators.data_structures import ListPopOpts
|
||||
from tensorflow.contrib.autograph.operators.data_structures import ListStackOpts
|
||||
from tensorflow.contrib.autograph.operators.data_structures import new_list
|
||||
from tensorflow.contrib.autograph.operators.py_builtins import float_
|
||||
from tensorflow.contrib.autograph.operators.py_builtins import int_
|
||||
from tensorflow.contrib.autograph.operators.py_builtins import len_
|
||||
from tensorflow.contrib.autograph.operators.py_builtins import print_
|
||||
from tensorflow.contrib.autograph.operators.py_builtins import range_
|
||||
from tensorflow.contrib.autograph.operators.slices import get_item
|
||||
from tensorflow.contrib.autograph.operators.slices import GetItemOpts
|
||||
from tensorflow.contrib.autograph.operators.slices import set_item
|
||||
from tensorflow.python.autograph.operators.control_flow import for_stmt
|
||||
from tensorflow.python.autograph.operators.control_flow import while_stmt
|
||||
from tensorflow.python.autograph.operators.data_structures import list_append
|
||||
from tensorflow.python.autograph.operators.data_structures import list_pop
|
||||
from tensorflow.python.autograph.operators.data_structures import list_stack
|
||||
from tensorflow.python.autograph.operators.data_structures import ListPopOpts
|
||||
from tensorflow.python.autograph.operators.data_structures import ListStackOpts
|
||||
from tensorflow.python.autograph.operators.data_structures import new_list
|
||||
from tensorflow.python.autograph.operators.py_builtins import float_
|
||||
from tensorflow.python.autograph.operators.py_builtins import int_
|
||||
from tensorflow.python.autograph.operators.py_builtins import len_
|
||||
from tensorflow.python.autograph.operators.py_builtins import print_
|
||||
from tensorflow.python.autograph.operators.py_builtins import range_
|
||||
from tensorflow.python.autograph.operators.slices import get_item
|
||||
from tensorflow.python.autograph.operators.slices import GetItemOpts
|
||||
from tensorflow.python.autograph.operators.slices import set_item
|
@ -18,7 +18,7 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.operators import py_builtins
|
||||
from tensorflow.python.autograph.operators import py_builtins
|
||||
from tensorflow.python.data.ops import dataset_ops
|
||||
from tensorflow.python.framework import ops
|
||||
from tensorflow.python.framework import tensor_util
|
@ -18,7 +18,7 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.operators import control_flow
|
||||
from tensorflow.python.autograph.operators import control_flow
|
||||
from tensorflow.python.data.ops import dataset_ops
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
@ -18,7 +18,7 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.operators import data_structures
|
||||
from tensorflow.python.autograph.operators import data_structures
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import ops
|
@ -23,8 +23,8 @@ from __future__ import print_function
|
||||
|
||||
import six
|
||||
|
||||
from tensorflow.contrib.autograph.utils import py_func
|
||||
from tensorflow.contrib.autograph.utils import tensors
|
||||
from tensorflow.python.autograph.utils import py_func
|
||||
from tensorflow.python.autograph.utils import tensors
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import ops
|
@ -22,8 +22,8 @@ import sys
|
||||
|
||||
import six
|
||||
|
||||
from tensorflow.contrib.autograph.operators import data_structures
|
||||
from tensorflow.contrib.autograph.operators import py_builtins
|
||||
from tensorflow.python.autograph.operators import data_structures
|
||||
from tensorflow.python.autograph.operators import py_builtins
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import errors_impl
|
@ -18,7 +18,7 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.operators import slices
|
||||
from tensorflow.python.autograph.operators import slices
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.ops import list_ops
|
||||
from tensorflow.python.platform import test
|
@ -20,7 +20,7 @@ from __future__ import print_function
|
||||
|
||||
import ast
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -22,8 +22,8 @@ import ast
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
|
||||
|
||||
class CleanCopier(object):
|
@ -22,11 +22,11 @@ import ast
|
||||
import collections
|
||||
import textwrap
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import ast_util
|
||||
from tensorflow.contrib.autograph.pyct import compiler
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.contrib.autograph.pyct import qual_names
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import ast_util
|
||||
from tensorflow.python.autograph.pyct import compiler
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import qual_names
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -33,7 +33,7 @@ from enum import Enum
|
||||
import gast
|
||||
# pylint:enable=g-bad-import-order
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import compiler
|
||||
from tensorflow.python.autograph.pyct import compiler
|
||||
|
||||
|
||||
class Node(object):
|
@ -18,8 +18,8 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import cfg
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import cfg
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -26,7 +26,7 @@ py_library(
|
||||
"@six_archive//:six",
|
||||
# TODO(aqj) Revisit this dependency direction when pyct is more
|
||||
# modularized
|
||||
"//tensorflow/contrib/autograph/pyct",
|
||||
"//tensorflow/python/autograph/pyct",
|
||||
],
|
||||
)
|
||||
|
@ -29,8 +29,8 @@ from __future__ import print_function
|
||||
import gast
|
||||
import six
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import templates
|
||||
from tensorflow.contrib.autograph.pyct import transformer
|
||||
from tensorflow.python.autograph.pyct import templates
|
||||
from tensorflow.python.autograph.pyct import transformer
|
||||
|
||||
|
||||
class DummyGensym(object):
|
@ -20,10 +20,10 @@ from __future__ import print_function
|
||||
|
||||
import textwrap
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import compiler
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.contrib.autograph.pyct import transformer
|
||||
from tensorflow.contrib.autograph.pyct.common_transformers import anf
|
||||
from tensorflow.python.autograph.pyct import compiler
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import transformer
|
||||
from tensorflow.python.autograph.pyct.common_transformers import anf
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -30,7 +30,7 @@ import tempfile
|
||||
import astor
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import origin_info
|
||||
from tensorflow.python.autograph.pyct import origin_info
|
||||
|
||||
|
||||
def ast_to_source(node, indentation=' '):
|
@ -22,8 +22,8 @@ import textwrap
|
||||
|
||||
import gast
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import compiler
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import compiler
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.platform import test
|
||||
from tensorflow.python.util import tf_inspect
|
||||
|
@ -22,7 +22,7 @@ from functools import wraps
|
||||
|
||||
import six
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import inspect_utils
|
||||
from tensorflow.python.autograph.pyct import inspect_utils
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -23,9 +23,9 @@ import tokenize
|
||||
import gast
|
||||
import six
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import ast_util
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import ast_util
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.util import tf_inspect
|
||||
|
||||
|
@ -18,10 +18,10 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import anno
|
||||
from tensorflow.contrib.autograph.pyct import compiler
|
||||
from tensorflow.contrib.autograph.pyct import origin_info
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import anno
|
||||
from tensorflow.python.autograph.pyct import compiler
|
||||
from tensorflow.python.autograph.pyct import origin_info
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -20,7 +20,7 @@ from __future__ import print_function
|
||||
|
||||
import textwrap
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import parser
|
||||
from tensorflow.python.autograph.pyct import parser
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -20,7 +20,7 @@ from __future__ import print_function
|
||||
|
||||
import ast
|
||||
|
||||
from tensorflow.contrib.autograph.pyct import pretty_printer
|
||||
from tensorflow.python.autograph.pyct import pretty_printer
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user