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

[phi] move bce_loss to phi #39868

Merged
merged 4 commits into from
Feb 24, 2022
Merged

[phi] move bce_loss to phi #39868

merged 4 commits into from
Feb 24, 2022

Conversation

linjieccc
Copy link
Contributor

@linjieccc linjieccc commented Feb 23, 2022

PR types

Function optimization

PR changes

OPs

Describe

move bce_loss to phi

CUDA Kernel里面只能使用PADDLE_ENFORCE进行错误检查,且不能使用CPU端定义的error类型
参考:#32265

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@chenwhql chenwhql left a comment

Choose a reason for hiding this comment

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

LGTM

label_dims));
}

out->set_dims(input_dims);
Copy link
Contributor

Choose a reason for hiding this comment

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

这里InferMeta范围要比原先的InferShape广,InferMeta推断的是tensor中的meta信息,包括推断dtype,所以在迁移时顺便加一下set_dtype()更好一些,后面可以再加,指南里我也补充了一下

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的,我在下个PR加下

@chenwhql chenwhql merged commit 6fc5d88 into PaddlePaddle:develop Feb 24, 2022
@linjieccc linjieccc deleted the move_bce_loss branch February 24, 2022 06:16
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.

3 participants