aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler
diff options
context:
space:
mode:
authorGravatar Alexandre Passos <apassos@google.com>2018-09-27 13:18:33 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-27 13:23:04 -0700
commit4cedc8b6e738b7a188c9c091cf667bacafae44b7 (patch)
tree56de35940e5f9daedd5f39a82d2cd90cf374e4e4 /tensorflow/compiler
parentc898e63d07fc63315be98f0772736e5d7f2fb44c (diff)
Updating the V2 variables API.
PiperOrigin-RevId: 214824023
Diffstat (limited to 'tensorflow/compiler')
-rw-r--r--tensorflow/compiler/aot/tests/make_test_graphs.py4
-rw-r--r--tensorflow/compiler/tests/lstm.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/compiler/aot/tests/make_test_graphs.py b/tensorflow/compiler/aot/tests/make_test_graphs.py
index de135d7a23..64b861a730 100644
--- a/tensorflow/compiler/aot/tests/make_test_graphs.py
+++ b/tensorflow/compiler/aot/tests/make_test_graphs.py
@@ -47,7 +47,7 @@ def tfadd(_):
def tfadd_with_ckpt(out_dir):
x = array_ops.placeholder(dtypes.int32, name='x_hold')
- y = variables.Variable(constant_op.constant([0]), name='y_saved')
+ y = variables.VariableV1(constant_op.constant([0]), name='y_saved')
math_ops.add(x, y, name='x_y_sum')
init_op = variables.initialize_all_variables()
@@ -62,7 +62,7 @@ def tfadd_with_ckpt(out_dir):
def tfadd_with_ckpt_saver(out_dir):
x = array_ops.placeholder(dtypes.int32, name='x_hold')
- y = variables.Variable(constant_op.constant([0]), name='y_saved')
+ y = variables.VariableV1(constant_op.constant([0]), name='y_saved')
math_ops.add(x, y, name='x_y_sum')
init_op = variables.initialize_all_variables()
diff --git a/tensorflow/compiler/tests/lstm.py b/tensorflow/compiler/tests/lstm.py
index 43c469d032..73b3638e80 100644
--- a/tensorflow/compiler/tests/lstm.py
+++ b/tensorflow/compiler/tests/lstm.py
@@ -117,7 +117,7 @@ def LSTMLayer(cell_name, weights, m, c, x_seq, pad_seq):
def RandomVar(shape, name=None):
"""Returns a variable of the given shape initialized to random values."""
- return variables.Variable(
+ return variables.VariableV1(
random_ops.random_uniform(shape), dtype=dtypes.float32, name=name)