Skip to content

Commit

Permalink
Potential fix for HIPS#581
Browse files Browse the repository at this point in the history
  • Loading branch information
yairchu committed Aug 31, 2022
1 parent 2afc187 commit 1eb35ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autograd/numpy/numpy_vjps.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
defvjp(anp.remainder, lambda ans, x, y : unbroadcast_f(x, lambda g: g),
lambda ans, x, y : unbroadcast_f(y, lambda g: -g * anp.floor(x/y)))
defvjp(anp.power,
lambda ans, x, y : unbroadcast_f(x, lambda g: g * y * x ** anp.where(y, y - 1, 1.)),
lambda ans, x, y : unbroadcast_f(x, lambda g: g * y * x ** anp.where(x, anp.where(y, y - 1, 1.), 1.)),
lambda ans, x, y : unbroadcast_f(y, lambda g: g * anp.log(replace_zero(x, 1.)) * ans))
defvjp(anp.arctan2, lambda ans, x, y : unbroadcast_f(x, lambda g: g * y / (x**2 + y**2)),
lambda ans, x, y : unbroadcast_f(y, lambda g: g * -x / (x**2 + y**2)))
Expand Down

0 comments on commit 1eb35ac

Please sign in to comment.