未验证 提交 f1b4e4d5 编写于 作者: Z zyfncg 提交者: GitHub

fix the problem of slice infer shape (#42568) (#43246)

上级 e09803c5
...@@ -306,8 +306,9 @@ def get_value_for_bool_tensor(var, item): ...@@ -306,8 +306,9 @@ def get_value_for_bool_tensor(var, item):
return paddle.empty(var_shape, dtype=var.dtype) return paddle.empty(var_shape, dtype=var.dtype)
from .layers.control_flow import cond from .layers.control_flow import cond
return cond(item.any(), lambda: idx_not_empty(var, item), return cond(
lambda: idx_empty(var)) paddle.logical_not(item.any()), lambda: idx_empty(var),
lambda: idx_not_empty(var, item))
def _getitem_impl_(var, item): def _getitem_impl_(var, item):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册