Skip to content

Commit

Permalink
Merges variable_scope.variable and tf.Variable
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 205267974
  • Loading branch information
TensorFlow Hub Authors authored and andresusanopinto committed Jul 20, 2018
1 parent 7b5c69e commit 2556ad7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tensorflow_hub/native_module_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,8 @@ def bad_state_colocation_module_fn():

def good_colocation_module_fn():
w = tf.Variable(42 + 69, name="w")
with tf.colocate_with(w):
# w.op has the same name on resource and non-resource variables
with tf.colocate_with(w.op):
# Colocation references among state nodes is ok.
v = tf.Variable(1.0, name="v")
assert v.op.colocation_groups() == [tf.compat.as_bytes("loc:@w")]
Expand Down

0 comments on commit 2556ad7

Please sign in to comment.