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

multiple data type support #5646

Closed
dzhwinter opened this issue Nov 14, 2017 · 1 comment
Closed

multiple data type support #5646

dzhwinter opened this issue Nov 14, 2017 · 1 comment

Comments

@dzhwinter
Copy link
Contributor

dzhwinter commented Nov 14, 2017

The kernel register macro need to support multiple data types, not only in CPU operators but also in GPU operators. Our register need to duplicate the same macro many times, which should be improved soon.
For example,

REGISTER_OP_CPU_KERNEL(
    elementwise_sub_grad,
    ops::ElementwiseSubGradKernel<paddle::platform::CPUPlace, float>,
    ops::ElementwiseSubGradKernel<paddle::platform::CPUPlace, double>,
    ops::ElementwiseSubGradKernel<paddle::platform::CPUPlace, int>,
    ops::ElementwiseSubGradKernel<paddle::platform::CPUPlace, int64_t>);

can be simplifid into format of

using NumricTypes = TensorTypes<int, int64_t, float, double>;
REGISTER_OP_CPU_KERNEL(
    elementwise_sub_grad,
  ops::ElementwiseSubGradKernel<paddle::platform::CPUPlace>, NumricTypes)

(just pseudo code)

@dzhwinter
Copy link
Contributor Author

This issue is a proposal, which has been implemented in the latest develop branch.

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

No branches or pull requests

1 participant