diff options
author | Alexandre Passos <apassos@google.com> | 2018-09-27 13:18:33 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-09-27 13:23:04 -0700 |
commit | 4cedc8b6e738b7a188c9c091cf667bacafae44b7 (patch) | |
tree | 56de35940e5f9daedd5f39a82d2cd90cf374e4e4 /tensorflow/python/framework | |
parent | c898e63d07fc63315be98f0772736e5d7f2fb44c (diff) |
Updating the V2 variables API.
PiperOrigin-RevId: 214824023
Diffstat (limited to 'tensorflow/python/framework')
-rw-r--r-- | tensorflow/python/framework/function_test.py | 2 | ||||
-rw-r--r-- | tensorflow/python/framework/graph_util_test.py | 8 | ||||
-rw-r--r-- | tensorflow/python/framework/subscribe_test.py | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/tensorflow/python/framework/function_test.py b/tensorflow/python/framework/function_test.py index f740e5cfaa..87f567db0e 100644 --- a/tensorflow/python/framework/function_test.py +++ b/tensorflow/python/framework/function_test.py @@ -113,7 +113,7 @@ class FunctionTest(test.TestCase): return a with ops.Graph().as_default(): - var = variables.Variable([18.0]) + var = variables.VariableV1([18.0]) call = MyIdentityFunc(var._ref()) # pylint: disable=protected-access self.assertEqual("MyIdentity", call.op.name) for cfg in _OptimizerOptions(): diff --git a/tensorflow/python/framework/graph_util_test.py b/tensorflow/python/framework/graph_util_test.py index 2dafb94ba7..563a177dd0 100644 --- a/tensorflow/python/framework/graph_util_test.py +++ b/tensorflow/python/framework/graph_util_test.py @@ -104,13 +104,13 @@ class DeviceFunctionsTest(test.TestCase): def testNestedDeviceFunctions(self): with ops.Graph().as_default(): - var_0 = variables.Variable(0) + var_0 = variables.VariableV1(0) with ops.device(test_device_func_pin_variable_to_cpu): - var_1 = variables.Variable(1) + var_1 = variables.VariableV1(1) with ops.device(lambda op: "/device:GPU:0"): - var_2 = variables.Variable(2) + var_2 = variables.VariableV1(2) with ops.device("/device:GPU:0"): # Implicit merging device function. - var_3 = variables.Variable(3) + var_3 = variables.VariableV1(3) self.assertDeviceEqual(var_0.device, None) self.assertDeviceEqual(var_1.device, "/device:CPU:0") diff --git a/tensorflow/python/framework/subscribe_test.py b/tensorflow/python/framework/subscribe_test.py index 1d594e4078..cab426844d 100644 --- a/tensorflow/python/framework/subscribe_test.py +++ b/tensorflow/python/framework/subscribe_test.py @@ -212,8 +212,8 @@ class SubscribeTest(test_util.TensorFlowTestCase): def testSubscribeVariable(self): """Confirm that variables can be subscribed.""" - v1 = variables.Variable(0.0) - v2 = variables.Variable(4.0) + v1 = variables.VariableV1(0.0) + v2 = variables.VariableV1(4.0) add = math_ops.add(v1, v2) assign_v1 = v1.assign(3.0) |