-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
move histogram to pten #39496
move histogram to pten #39496
Conversation
Thanks for your contribution! |
@@ -412,6 +412,8 @@ void BuildDygraphPtenKernelContext( | |||
kernel_ctx->EmplaceBackAttr(BOOST_GET_CONST(float, attr)); | |||
} else if (attr_defs[i].type_index == std::type_index(typeid(bool))) { | |||
kernel_ctx->EmplaceBackAttr(BOOST_GET_CONST(bool, attr)); | |||
} else if (attr_defs[i].type_index == std::type_index(typeid(int64_t))) { |
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.
缩进多了一个空格?
// REGISTER_OP_CPU_KERNEL( | ||
// histogram, ops::HistogramKernel<paddle::platform::CPUDeviceContext, float>, | ||
// ops::HistogramKernel<paddle::platform::CPUDeviceContext, double>, | ||
// ops::HistogramKernel<paddle::platform::CPUDeviceContext, int>, | ||
// ops::HistogramKernel<paddle::platform::CPUDeviceContext, int64_t>); |
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.
这段注释要不要去掉?
const DenseTensor& input, | ||
int64_t bins, | ||
int min, | ||
int max, | ||
DenseTensor* output) | ||
{ |
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.
缩进好像有点问题?
@@ -0,0 +1,77 @@ | |||
|
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.
License?
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
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.
License?
@@ -0,0 +1,16 @@ | |||
|
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.
License?
const DenseTensor& input, | ||
int64_t bins, | ||
int min, | ||
int max, | ||
DenseTensor* out); |
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.
同缩进似乎有问题?
@@ -0,0 +1,15 @@ | |||
|
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.
License?
input_min_t.mutable_data<T>({1}, dev_ctx.GetPlace()); | ||
auto* input_max_data = | ||
input_max_t.mutable_data<T>({1}, context.GetPlace()); | ||
auto input_min_scala = framework::EigenScalar<T>::From(input_min_t); | ||
auto input_max_scala = framework::EigenScalar<T>::From(input_max_t); | ||
input_max_t.mutable_data<T>({1}, dev_ctx.GetPlace()); |
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.
这里要替换成Alloc吗?
const T* input_data = input.data<T>(); | ||
auto input_numel = input.numel(); | ||
|
||
int64_t* out_data = output->mutable_data<int64_t>(dev_ctx.GetPlace()); |
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.
这里要替换成Alloc吗?
float, | ||
double, | ||
int, | ||
int64_t) {} |
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.
这里没有换行,格式应该会有问题
… move_histogram_to_pten
… move_histogram_to_pten
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
Breaking changes
PR changes
OPs
Describe
move histomgram op to pten