Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
cyber-pioneer committed Mar 16, 2023
1 parent 24bb5f1 commit 0e480fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions paddle/fluid/operators/batch_norm_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,7 @@ class BatchNormCompositeGradOpMaker : public prim::CompositeGradOpMakerBase {
paddle::Tensor saved_mean = this->GetSingleForwardOutput("SavedMean");
paddle::Tensor saved_variance =
this->GetSingleForwardOutput("SavedVariance");
paddle::optional<paddle::Tensor> reserve_space =
this->GetOptionalSingleForwardOutput("ReserveSpace");
paddle::optional<paddle::Tensor> reserve_space;

paddle::Tensor y_grad = this->GetSingleOutputGrad("Y");
paddle::Tensor x_grad = this->GetSingleInputGrad("X");
Expand All @@ -578,7 +577,7 @@ class BatchNormCompositeGradOpMaker : public prim::CompositeGradOpMakerBase {
auto use_global_stats = this->Attr<bool>("use_global_stats");
auto trainable_statistics = this->Attr<bool>("trainable_statistics");

VLOG(0) << "Runing batch_norm composite func";
VLOG(3) << "Runing batch_norm composite func";
prim::batch_norm_grad<prim::DescTensor>(x,
scale,
bias,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def setUp(self):
self.x.stop_gradient = False

def train(self, use_prim):
core._set_prim_backward_enabled(use_prim)
core._set_prim_all_enabled(use_prim)
paddle.seed(2022)
net = PrimeNet()
sgd = paddle.optimizer.SGD(
Expand Down

0 comments on commit 0e480fe

Please sign in to comment.