From 5df464feb8e52d7c6277b3c311521cacdbd98b33 Mon Sep 17 00:00:00 2001 From: wanghuancoder Date: Thu, 25 Aug 2022 19:00:24 +0800 Subject: [PATCH] [Eager] sync_batch_norm_grad delete mean and variance (#45411) * sync_batch_norm_grad delete mean and variance --- paddle/phi/api/yaml/legacy_backward.yaml | 4 ++-- paddle/phi/kernels/gpu/sync_batch_norm_grad_kernel.cu | 2 -- paddle/phi/kernels/sync_batch_norm_grad_kernel.h | 2 -- paddle/phi/ops/compat/sync_batch_norm_sig.cc | 2 -- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/paddle/phi/api/yaml/legacy_backward.yaml b/paddle/phi/api/yaml/legacy_backward.yaml index 0232c03e2c3..176491491b9 100755 --- a/paddle/phi/api/yaml/legacy_backward.yaml +++ b/paddle/phi/api/yaml/legacy_backward.yaml @@ -2460,7 +2460,7 @@ - backward_api : sync_batch_norm_grad forward : sync_batch_norm_ (Tensor x, Tensor scale, Tensor bias, Tensor mean, Tensor variance, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics, bool fuse_with_relu) -> Tensor(out), Tensor(mean_out), Tensor(variance_out), Tensor(saved_mean), Tensor(saved_variance), Tensor(reserve_space) - args : (Tensor x, Tensor scale, Tensor bias, Tensor mean_out, Tensor variance_out, Tensor saved_mean, Tensor saved_variance, Tensor reserve_space, Tensor out_grad, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics, bool fuse_with_relu) + args : (Tensor x, Tensor scale, Tensor bias, Tensor saved_mean, Tensor saved_variance, Tensor reserve_space, Tensor out_grad, float momentum, float epsilon, str data_layout, bool is_test, bool use_global_stats, bool trainable_statistics, bool fuse_with_relu) output : Tensor(x_grad), Tensor(scale_grad), Tensor(bias_grad) infer_meta : func : GeneralTernaryGradInferMeta @@ -2468,7 +2468,7 @@ kernel : func : sync_batch_norm_grad data_type : out_grad - optional : mean_out, variance_out, reserve_space + optional : reserve_space - backward_api : take_along_axis_grad forward : take_along_axis (Tensor x, Tensor index, int axis) -> Tensor(out) diff --git a/paddle/phi/kernels/gpu/sync_batch_norm_grad_kernel.cu b/paddle/phi/kernels/gpu/sync_batch_norm_grad_kernel.cu index ba5020d08bd..5cf7aabda30 100644 --- a/paddle/phi/kernels/gpu/sync_batch_norm_grad_kernel.cu +++ b/paddle/phi/kernels/gpu/sync_batch_norm_grad_kernel.cu @@ -24,8 +24,6 @@ void SyncBatchNormGradKernel(const Context& ctx, const DenseTensor& x, const DenseTensor& scale, const DenseTensor& bias, - const paddle::optional& mean, - const paddle::optional& variance, const DenseTensor& saved_mean, const DenseTensor& saved_variance, const paddle::optional& reserve_space, diff --git a/paddle/phi/kernels/sync_batch_norm_grad_kernel.h b/paddle/phi/kernels/sync_batch_norm_grad_kernel.h index 395bec23f10..a38f42c29f6 100644 --- a/paddle/phi/kernels/sync_batch_norm_grad_kernel.h +++ b/paddle/phi/kernels/sync_batch_norm_grad_kernel.h @@ -25,8 +25,6 @@ void SyncBatchNormGradKernel(const Context& dev_ctx, const DenseTensor& x, const DenseTensor& scale, const DenseTensor& bias, - const paddle::optional& mean, - const paddle::optional& variance, const DenseTensor& saved_mean, const DenseTensor& saved_variance, const paddle::optional& reserve_space, diff --git a/paddle/phi/ops/compat/sync_batch_norm_sig.cc b/paddle/phi/ops/compat/sync_batch_norm_sig.cc index 2595f241ff2..9380751987e 100644 --- a/paddle/phi/ops/compat/sync_batch_norm_sig.cc +++ b/paddle/phi/ops/compat/sync_batch_norm_sig.cc @@ -42,8 +42,6 @@ KernelSignature SyncBatchNormGradOpArgumentMapping( "X", "Scale", "Bias", - "Mean", - "Variance", "SavedMean", "SavedVariance", "ReserveSpace", -- GitLab