-
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
[phi] migrate atan2_op into phi #39806
Conversation
@@ -225,4 +225,9 @@ void HuberLossInferMeta(const MetaTensor& input, | |||
out->share_lod(input); | |||
} | |||
|
|||
void Atan2InferMeta(const MetaTensor& x, const MetaTensor& y, MetaTensor* out) { | |||
auto in_dims = x.dims(); | |||
out->set_dims(in_dims); |
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.
这里还需要设置dtype, layout,lod
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.
细节问题可以在后续PR顺带完善一下
|
||
#include "paddle/phi/kernels/atan2_grad_kernel.h" | ||
#include "paddle/phi/backends/cpu/cpu_context.h" | ||
#include "paddle/phi/core/device_context.h" |
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.
这个头文件应该可以去掉,只include cpu_context.h就可以
|
||
#include "paddle/phi/kernels/atan2_kernel.h" | ||
#include "paddle/phi/backends/cpu/cpu_context.h" | ||
#include "paddle/phi/core/device_context.h" |
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.
同上
// limitations under the License. | ||
|
||
#include "paddle/phi/backends/gpu/gpu_context.h" | ||
#include "paddle/phi/core/device_context.h" |
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.
同上
#include "paddle/phi/backends/gpu/gpu_context.h" | ||
#include "paddle/phi/core/device_context.h" | ||
#include "paddle/phi/core/kernel_registry.h" | ||
#include "paddle/phi/kernels/atan2_kernel.h" |
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.
kernel头文件建议放到最上面,和下面的用空格隔开
|
||
#include "paddle/fluid/platform/for_range.h" | ||
#include "paddle/phi/core/dense_tensor.h" | ||
#include "paddle/phi/kernels/atan2_grad_kernel.h" |
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.
同上
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "paddle/phi/kernels/atan2_kernel.h" |
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.
这里加一个空行,隔开本身实现的atan2_kernel.h 头文件和其他依赖的头文件
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "paddle/phi/kernels/atan2_grad_kernel.h" |
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.
这里加一个空行,隔开本身实现的atan2_kernel.h 头文件和其他依赖的头文件
#include "paddle/phi/backends/gpu/gpu_context.h" | ||
#include "paddle/phi/core/device_context.h" | ||
#include "paddle/phi/core/kernel_registry.h" | ||
#include "paddle/phi/kernels/atan2_grad_kernel.h" |
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.
头文件放到第一行,加空行
@@ -225,4 +225,9 @@ void HuberLossInferMeta(const MetaTensor& input, | |||
out->share_lod(input); | |||
} | |||
|
|||
void Atan2InferMeta(const MetaTensor& x, const MetaTensor& y, MetaTensor* 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.
可以参考UnchangedInferMeta写法
PR types
Others
PR changes
OPs
Describe
migrate atan2_op into phi