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

rename_bilinear_tensor_product #52375

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion paddle/phi/api/yaml/legacy_backward.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
infer_meta :
func : BilinearTensorProductGradInferMeta
kernel :
func : bilinear_tensor_product_grad
func : bilinear_grad

- backward_op : cast_grad
forward : cast (Tensor x, DataType dtype) -> Tensor(out)
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/api/yaml/legacy_ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
infer_meta :
func : BilinearTensorProductInferMeta
kernel :
func : bilinear_tensor_product
func : bilinear
zhangyuqin1998 marked this conversation as resolved.
Show resolved Hide resolved
optional : bias
backward : bilinear_tensor_product_grad

Expand Down
18 changes: 9 additions & 9 deletions paddle/phi/kernels/bilinear_tensor_product_grad_kernel.h
zhangyuqin1998 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
namespace phi {

template <typename T, typename Context>
void BilinearTensorProductGradKernel(const Context& dev_ctx,
const DenseTensor& x,
const DenseTensor& y,
const DenseTensor& weight,
const DenseTensor& dout,
DenseTensor* dx,
DenseTensor* dy,
DenseTensor* dweight,
DenseTensor* dbias);
void BilinearGradKernel(const Context& dev_ctx,
const DenseTensor& x,
const DenseTensor& y,
const DenseTensor& weight,
const DenseTensor& dout,
DenseTensor* dx,
DenseTensor* dy,
DenseTensor* dweight,
DenseTensor* dbias);

} // namespace phi
12 changes: 6 additions & 6 deletions paddle/phi/kernels/bilinear_tensor_product_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
namespace phi {

template <typename T, typename Context>
void BilinearTensorProductKernel(const Context& dev_ctx,
const DenseTensor& x,
const DenseTensor& y,
const DenseTensor& weight,
const paddle::optional<DenseTensor>& bias,
DenseTensor* out);
void BilinearKernel(const Context& dev_ctx,
const DenseTensor& x,
const DenseTensor& y,
const DenseTensor& weight,
const paddle::optional<DenseTensor>& bias,
DenseTensor* out);

} // namespace phi
8 changes: 2 additions & 6 deletions paddle/phi/kernels/cpu/bilinear_tensor_product_grad_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/impl/bilinear_tensor_product_grad_kernel_impl.h"

PD_REGISTER_KERNEL(bilinear_tensor_product_grad,
CPU,
ALL_LAYOUT,
phi::BilinearTensorProductGradKernel,
float,
double) {}
PD_REGISTER_KERNEL(
bilinear_grad, CPU, ALL_LAYOUT, phi::BilinearGradKernel, float, double) {}
8 changes: 2 additions & 6 deletions paddle/phi/kernels/cpu/bilinear_tensor_product_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/impl/bilinear_tensor_product_kernel_impl.h"

PD_REGISTER_KERNEL(bilinear_tensor_product,
CPU,
ALL_LAYOUT,
phi::BilinearTensorProductKernel,
float,
double) {}
PD_REGISTER_KERNEL(
bilinear, CPU, ALL_LAYOUT, phi::BilinearKernel, float, double) {}
8 changes: 2 additions & 6 deletions paddle/phi/kernels/gpu/bilinear_tensor_product_grad_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/impl/bilinear_tensor_product_grad_kernel_impl.h"

PD_REGISTER_KERNEL(bilinear_tensor_product_grad,
GPU,
ALL_LAYOUT,
phi::BilinearTensorProductGradKernel,
float,
double) {}
PD_REGISTER_KERNEL(
bilinear_grad, GPU, ALL_LAYOUT, phi::BilinearGradKernel, float, double) {}
8 changes: 2 additions & 6 deletions paddle/phi/kernels/gpu/bilinear_tensor_product_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/impl/bilinear_tensor_product_kernel_impl.h"

PD_REGISTER_KERNEL(bilinear_tensor_product,
GPU,
ALL_LAYOUT,
phi::BilinearTensorProductKernel,
float,
double) {}
PD_REGISTER_KERNEL(
bilinear, GPU, ALL_LAYOUT, phi::BilinearKernel, float, double) {}
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
namespace phi {

template <typename T, typename Context>
void BilinearTensorProductGradKernel(const Context& ctx,
const DenseTensor& x,
const DenseTensor& y,
const DenseTensor& weight,
const DenseTensor& dout,
DenseTensor* dx,
DenseTensor* dy,
DenseTensor* dweight,
DenseTensor* dbias) {
void BilinearGradKernel(const Context& ctx,
const DenseTensor& x,
const DenseTensor& y,
const DenseTensor& weight,
const DenseTensor& dout,
DenseTensor* dx,
DenseTensor* dy,
DenseTensor* dweight,
DenseTensor* dbias) {
auto batch_size = x.dims()[0];
auto weight_dims = weight.dims();
int out_dim = weight_dims[0];
Expand Down
12 changes: 6 additions & 6 deletions paddle/phi/kernels/impl/bilinear_tensor_product_kernel_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
namespace phi {

template <typename T, typename Context>
void BilinearTensorProductKernel(const Context& ctx,
const DenseTensor& x,
const DenseTensor& y,
const DenseTensor& weight,
const paddle::optional<DenseTensor>& bias,
DenseTensor* out) {
void BilinearKernel(const Context& ctx,
const DenseTensor& x,
const DenseTensor& y,
const DenseTensor& weight,
const paddle::optional<DenseTensor>& bias,
DenseTensor* out) {
ctx.template Alloc<T>(out);

auto y_mat = EigenMatrix<T>::From(y);
Expand Down
5 changes: 2 additions & 3 deletions paddle/phi/ops/compat/bilinear_tensor_product_sig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ namespace phi {

KernelSignature BilinearTensorProductOpArgumentMapping(
const ArgumentMappingContext& ctx) {
return KernelSignature(
"bilinear_tensor_product", {"X", "Y", "Weight", "Bias"}, {}, {"Out"});
return KernelSignature("bilinear", {"X", "Y", "Weight", "Bias"}, {}, {"Out"});
}

KernelSignature BilinearTensorProductGradOpArgumentMapping(
const ArgumentMappingContext& ctx) {
return KernelSignature("bilinear_tensor_product_grad",
return KernelSignature("bilinear_grad",
{"X", "Y", "Weight", "Out@GRAD"},
{},
{"X@GRAD", "Y@GRAD", "Weight@GRAD", "Bias@GRAD"});
Expand Down