Skip to content

Commit

Permalink
stype(acc_op): reformat codes
Browse files Browse the repository at this point in the history
  • Loading branch information
JieRen98 authored and XuehaiPan committed Nov 2, 2022
1 parent 173da9a commit 2b0d5b6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/adam_op/adam_op_impl_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ TensorArray<3> adamForwardInplaceCPU(const torch::Tensor &updates,

nu.mul_(scalar_t(b2)).addcmul_(updates, updates.conj(), 1 - scalar_t(b2));

updates.copy_(
mu.mul(scalar_t(inv_one_minus_pow_b1))
.div_(nu.mul(inv_one_minus_pow_b2).add_(scalar_t(eps_root)).sqrt_().add_(scalar_t(eps))));
updates.copy_(mu.mul(scalar_t(inv_one_minus_pow_b1))
.div_(nu.mul(inv_one_minus_pow_b2)
.add_(scalar_t(eps_root))
.sqrt_()
.add_(scalar_t(eps))));
}));
return TensorArray<3>{updates, mu, nu};
}
Expand Down

0 comments on commit 2b0d5b6

Please # to comment.