Skip to content

Commit a2f3891

Browse files
committed
2 parents 7408367 + bb459e0 commit a2f3891

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎op/fused_act.py‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ def forward(ctx, grad_output, out, bias, negative_slope, scale):
4747
def backward(ctx, gradgrad_input, gradgrad_bias):
4848
out, = ctx.saved_tensors
4949
gradgrad_out = fused.fused_bias_act(
50-
gradgrad_input, gradgrad_bias, out, 3, 1, ctx.negative_slope, ctx.scale
50+
gradgrad_input.contiguous(),
51+
gradgrad_bias,
52+
out,
53+
3,
54+
1,
55+
ctx.negative_slope,
56+
ctx.scale,
5157
)
5258

5359
return gradgrad_out, None, None, None, None
@@ -116,4 +122,6 @@ def fused_leaky_relu(input, bias=None, negative_slope=0.2, scale=2 ** 0.5):
116122
return F.leaky_relu(input, negative_slope=0.2) * scale
117123

118124
else:
119-
return FusedLeakyReLUFunction.apply(input, bias, negative_slope, scale)
125+
return FusedLeakyReLUFunction.apply(
126+
input.contiguous(), bias, negative_slope, scale
127+
)

0 commit comments

Comments
 (0)