mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-07 12:20:24 +01:00
Automated g4 rollback of changelist 172654120
PiperOrigin-RevId: 173630195
This commit is contained in:
parent
a710cb323a
commit
a494558127
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user