Skip to content

Commit

Permalink
Merge pull request #437 from google/issue433
Browse files Browse the repository at this point in the history
fix symbolic zero handling in sub transpose
  • Loading branch information
mattjj committed Feb 23, 2019
2 parents f08c3b7 + 1171626 commit aca4941
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jax/lax.py
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ def _add_transpose(t, x, y):

def _sub_transpose(t, x, y):
assert x is None and y is None # computation must be linear, not affine
return [t, neg(t)]
return [t, neg(t) if t is not ad_util.zero else ad_util.zero]

sub_p = standard_binop([_num, _num], 'sub')
ad.defjvp(sub_p,
Expand Down

0 comments on commit aca4941

Please sign in to comment.