From 2cda4e21d97115c35bdd8441250a436c9acab698 Mon Sep 17 00:00:00 2001 From: Siming Dai <908660116@qq.com> Date: Thu, 8 Sep 2022 11:02:01 +0800 Subject: [PATCH] Fix where xpu bug (#45832) --- python/paddle/tensor/search.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/python/paddle/tensor/search.py b/python/paddle/tensor/search.py index fd8beb0f933..e4458048edc 100644 --- a/python/paddle/tensor/search.py +++ b/python/paddle/tensor/search.py @@ -638,14 +638,6 @@ def where(condition, x=None, y=None, name=None): broadcast_x = x broadcast_y = y else: - if core.is_compiled_with_xpu(): - cond_int = paddle.cast(condition, x.dtype) - cond_not_int = paddle.cast(logical_not(condition), x.dtype) - out1 = paddle.multiply(x, cond_int) - out2 = paddle.multiply(y, cond_not_int) - out = paddle.add(out1, out2) - return out - zeros_like_x = paddle.zeros_like(x) zeros_like_y = paddle.zeros_like(y) zeros_like_condition = paddle.zeros_like(condition) -- GitLab