Skip to content

Commit

Permalink
fix an issue
Browse files Browse the repository at this point in the history
  • Loading branch information
taoleicn committed May 13, 2021
1 parent f2d8654 commit bcf6a0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions sru/cuda_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,11 @@ def backward(ctx, grad_h, grad_last):
is_custom
)

if skip_type > 0 and k_ == 3 and scale_x is not None:
grad_x.mul_(scale_x)
if skip_type > 0 and k_ == 3:
if scale_x is not None:
grad_x.mul_(scale_x)
else:
grad_x = None
if not is_custom:
grad_wc = grad_wc.sum(1).view(-1)
return grad_u, grad_x, grad_wc, grad_bias.sum(1).view(-1), grad_init, \
Expand Down
2 changes: 1 addition & 1 deletion sru/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.6.0.dev'
__version__ = '2.6.0.dev2'

0 comments on commit bcf6a0d

Please sign in to comment.