Remove the need to check if y is a tensor (always convert x if not)
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
parent
91914123c4
commit
39026d9e33
@ -439,8 +439,8 @@ def divide(x, y, name=None):
|
|||||||
# override names. Use a dummy class to track the runtime division behavior
|
# override names. Use a dummy class to track the runtime division behavior
|
||||||
return DivideDelegateWithName(x, name) / y
|
return DivideDelegateWithName(x, name) / y
|
||||||
else:
|
else:
|
||||||
# We do conversion here to make sure at least either x or y is a tensor.
|
# We do conversion here to make sure at least x is a tensor.
|
||||||
if not (tensor_util.is_tensor(x) or tensor_util.is_tensor(y)):
|
if not tensor_util.is_tensor(x):
|
||||||
x = ops.convert_to_tensor(x)
|
x = ops.convert_to_tensor(x)
|
||||||
return x / y
|
return x / y
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user