diff --git a/paddle/fluid/prim/api/auto_code_generated/tensor_operants_gen.py b/paddle/fluid/prim/api/auto_code_generated/tensor_operants_gen.py index 6c883bc57c39c6ff8ae5e78ddd03359620cb2510..659fbd80496ed68d199e87e4ff0d742f62b7836f 100644 --- a/paddle/fluid/prim/api/auto_code_generated/tensor_operants_gen.py +++ b/paddle/fluid/prim/api/auto_code_generated/tensor_operants_gen.py @@ -102,7 +102,7 @@ Tensor EagerTensorOperants::subtract(const Tensor& x, const Scalar& y) { } Tensor EagerTensorOperants::multiply(const Tensor& x, const Scalar& y) { - return ::multiply_ad_func(x, ::full_like_ad_func(x, y)); + return ::scale_ad_func(x, y, 0.0f, true); } Tensor EagerTensorOperants::divide(const Tensor& x, const Scalar& y) { @@ -118,7 +118,7 @@ Tensor EagerTensorOperants::subtract(const Scalar& x, const Tensor& y) { } Tensor EagerTensorOperants::multiply(const Scalar& x, const Tensor& y) { - return ::multiply_ad_func(::full_like_ad_func(y, x), y); + return ::scale_ad_func(y, x, 0.0f, true); } Tensor EagerTensorOperants::divide(const Scalar& x, const Tensor& y) { @@ -229,7 +229,7 @@ Tensor StaticTensorOperants::subtract(const Tensor& x, const Scalar& y) { } Tensor StaticTensorOperants::multiply(const Tensor& x, const Scalar& y) { - return paddle::prim::multiply(x, paddle::prim::full(x.shape(), y, x.dtype(), x.place())); + return paddle::prim::scale(x, y, 0.0f, true); } Tensor StaticTensorOperants::divide(const Tensor& x, const Scalar& y) { @@ -245,7 +245,7 @@ Tensor StaticTensorOperants::subtract(const Scalar& x, const Tensor& y) { } Tensor StaticTensorOperants::multiply(const Scalar& x, const Tensor& y) { - return paddle::prim::multiply(paddle::prim::full(y.shape(), x, y.dtype(), y.place()), y); + return paddle::prim::scale(y, x, 0.0f, true); } Tensor StaticTensorOperants::divide(const Scalar& x, const Tensor& y) { diff --git a/paddle/phi/api/yaml/generator/tensor_operants_gen.py b/paddle/phi/api/yaml/generator/tensor_operants_gen.py index 9a446a9f3bcdc5a4668936dcffba3e1c33b03b7d..5df297bbc950c2cfb2866fd1ebaf46a54facb7a4 100644 --- a/paddle/phi/api/yaml/generator/tensor_operants_gen.py +++ b/paddle/phi/api/yaml/generator/tensor_operants_gen.py @@ -277,7 +277,7 @@ Tensor PhiTensorOperants::subtract(const Tensor& x, const Scalar& y) { } Tensor PhiTensorOperants::multiply(const Tensor& x, const Scalar& y) { - return paddle::experimental::multiply(x, paddle::experimental::full_like(x, y)); + return paddle::experimental::scale(x, y, 0.0f, true); } Tensor PhiTensorOperants::divide(const Tensor& x, const Scalar& y) { @@ -293,7 +293,7 @@ Tensor PhiTensorOperants::subtract(const Scalar& x, const Tensor& y) { } Tensor PhiTensorOperants::multiply(const Scalar& x, const Tensor& y) { - return paddle::experimental::multiply(paddle::experimental::full_like(y, x), y); + return paddle::experimental::scale(y, x, 0.0f, true); } Tensor PhiTensorOperants::divide(const Scalar& x, const Tensor& y) {