Esempio n. 1
0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import numpy as np

from tensorflow.contrib.autograph import utils
from tensorflow.contrib.autograph.impl import api
from tensorflow.contrib.autograph.impl import config
from tensorflow.contrib.autograph.pyct import parser
from tensorflow.contrib.autograph.utils import py_func
from tensorflow.python.framework import constant_op
from tensorflow.python.platform import test

tf = utils.fake_tf()


class ApiTest(test.TestCase):
    def setUp(self):
        config.COMPILED_IMPORT_STATEMENTS = (
            'from __future__ import print_function',
            'from tensorflow.contrib.autograph import utils as '
            'autograph_utils', 'tf = autograph_utils.fake_tf()')

    def test_decorator_recurses(self):
        class TestClass(object):
            def called_member(self, a):
                if a < 0:
                    a = -a
                return a
Esempio n. 2
0
from __future__ import absolute_import
from __future__ import division
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.framework import constant_op
from tensorflow.python.platform import test


tf = utils.fake_tf()


class ApiTest(test.TestCase):

  def setUp(self):
    config.COMPILED_IMPORT_STATEMENTS = (
        'from __future__ import print_function',
        'from tensorflow.contrib.autograph import utils'
        ' as autograph_utils',
        'tf = autograph_utils.fake_tf()',
    )

  def test_decorator_recurses(self):

    class TestClass(object):