-
Notifications
You must be signed in to change notification settings - Fork 6k
paddle.masked_fill 在整型输入场景出现 int32/int64 类型读取不一致报错 #78462
Copy link
Copy link
Open
Labels
Description
bug描述 Describe the Bug
在最小复现中,paddle.masked_fill 报错:
ValueError: (InvalidArgument) The type of data we are trying to retrieve (int64) does not match the type of data (int32) currently contained in the container.
同样的测试在对照框架可运行成功,脚本复现标记为 REPRODUCED_PADDLE_ERROR_ONLY=True。
附上对应脚本:
pd_error_only_candidate_166_masked_fill.py
import numpy as np
import paddle
print("paddle:", paddle.__version__)
x = paddle.to_tensor(np.array([[1, 2], [3, 4]], dtype=np.int32))
mask = paddle.to_tensor(np.array([[True, False], [False, True]], dtype=np.bool_))
# 触发点
out = paddle.masked_fill(x, mask, 0)
print(out)ValueError: (InvalidArgument) The type of data we are trying to retrieve (int64) does not match the type of data (int32) currently contained in the container.
[Hint: Expected dtype() == phi::CppTypeToDataType<T>::Type(), but received dtype():7 != phi::CppTypeToDataType<T>::Type():9.] (at ..\paddle\phi\core\dense_tensor.cc:174)其他补充信息 Additional Supplementary Information
- 复现环境:Windows 11,Python 3.10.18,Paddle 3.2.0,CPU。
Reactions are currently unavailable