From 2b0d5b617f2d7d2f8283258cc168ec172fbc8ce6 Mon Sep 17 00:00:00 2001 From: Jie Ren Date: Sun, 30 Oct 2022 17:12:44 +0800 Subject: [PATCH] stype(acc_op): reformat codes --- src/adam_op/adam_op_impl_cpu.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/adam_op/adam_op_impl_cpu.cpp b/src/adam_op/adam_op_impl_cpu.cpp index 0e758b29f..b55858ecf 100644 --- a/src/adam_op/adam_op_impl_cpu.cpp +++ b/src/adam_op/adam_op_impl_cpu.cpp @@ -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}; }