Automated g4 rollback of changelist 172654120

PiperOrigin-RevId: 173630195
This commit is contained in:
Eugene Brevdo 2017-10-26 21:13:19 -07:00 committed by TensorFlower Gardener
parent a710cb323a
commit a494558127

View File

@ -2466,14 +2466,9 @@ def where(condition, x=None, y=None, name=None):
"""
if x is None and y is None:
with ops.name_scope(name, "Where", [condition]) as name:
# Temporarily create an old style WhereOp nodedef + Operation without the
# attribute "T".
# TODO(b/67720963): Roll this back when the issue is resolved.
condition = gen_math_ops.cast(condition, dtypes.bool)
output = gen_array_ops.where(input=condition, name=name)
if context.in_graph_mode():
output.op._node_def.attr.clear()
return output
condition = ops.convert_to_tensor(
condition, preferred_dtype=dtypes.bool, name="condition")
return gen_array_ops.where(input=condition, name=name)
elif x is not None and y is not None:
return gen_math_ops._select(condition=condition, t=x, e=y, name=name)
else: