-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PIR] A-17 Adapt transpose test_errors #61119
[PIR] A-17 Adapt transpose test_errors #61119
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
def test_x_dtype_check():
# the Input(x)'s dtype must be one of [bool, float16, float32, float64, int32, int64]
x1 = paddle.static.data(
name='x1', shape=[-1, 10, 5, 3], dtype='int8'
)
paddle.transpose(x1, perm=[1, 0, 2])
self.assertRaises(TypeError, test_x_dtype_check) 这块可能静态图的类型检查又一些滞后,可以看下能不能改一下transpose里的api,参考#60488 这里面的 mean 处理方法 |
x1 = paddle.static.data( | ||
name='x1', shape=[-1, 10, 5, 3], dtype='int8' | ||
) | ||
paddle.transpose(x1, perm=[1, 0, 2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transpose 的 kernel是支持int8类型的,只是老静态图python端检查代码有些滞后,需要在python/paddle/tensor/linalg.py的transpose函数老静态图分支的check_variable_and_dtype加上int8类型。然后这个测试case就可以不用加not in_pir_mode
的判断了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
收到
# the Input(x)'s dtype must be one of [bool, float16, float32, float64, int32, int64] | ||
x1 = paddle.static.data( | ||
name='x1', shape=[-1, 10, 5, 3], dtype='int8' | ||
if core.is_compiled_with_cuda(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transpose的cpu kernel也注册了float16类型,参见paddle/phi/kernels/cpu/transpose_kernel.cc。所以把这个测试case删掉吧~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
收到
CI有点问题没有触发,辛苦merger下develop然后再push一下,重新触发下CI~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Others
PR changes
Others
Description
A17 transpose