Skip to content
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

[Host] fix unique op bug #9908

Merged
merged 3 commits into from
Jan 11, 2023
Merged

[Host] fix unique op bug #9908

merged 3 commits into from
Jan 11, 2023

Conversation

mjp9527
Copy link
Collaborator

@mjp9527 mjp9527 commented Jan 6, 2023

PR Type

bug fix

PR Change

kernel && OP

Describe

修复unique op在Host端bug,PaddleSeg部分模型,但输出index用不到时,不用进行类型判断检测

@paddle-bot
Copy link

paddle-bot bot commented Jan 6, 2023

Thanks for your contribution!

lite/operators/unique_op.cc Outdated Show resolved Hide resolved
Comment on lines +385 to +387
UNIQUE_SET_OUT_PRECISION(index, dtype);
UNIQUE_SET_OUT_PRECISION(indices, dtype);
UNIQUE_SET_OUT_PRECISION(count, dtype);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不需要用宏。不用宏的代码量其实会更少

Copy link
Collaborator Author

@mjp9527 mjp9527 Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这块需要先判断index,indices,count是否为空,在判断dtype类型,不用宏就是写一堆if。感觉是个小问题,可以先不改吗

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

lite/kernels/host/unique_compute.cc Outdated Show resolved Hide resolved
lite/kernels/host/unique_compute.cc Outdated Show resolved Hide resolved
Copy link
Collaborator

@zhupengyang zhupengyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +61 to +62
CHECK(index_type_match) << "index type must be int32 or int64, but now is "
<< static_cast<int>(index_type);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PrecisionToStr 将 PrecisionType 转为 std::string,而不是直接打印 int 类型

Comment on lines +385 to +387
UNIQUE_SET_OUT_PRECISION(index, dtype);
UNIQUE_SET_OUT_PRECISION(indices, dtype);
UNIQUE_SET_OUT_PRECISION(count, dtype);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@mjp9527 mjp9527 merged commit 1410668 into PaddlePaddle:develop Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants