Spaces:
Runtime error
Runtime error
Update Time_TravelRephotography/op/fused_act.py
Browse files
Time_TravelRephotography/op/fused_act.py
CHANGED
@@ -71,10 +71,9 @@ class FusedLeakyReLUFunction(Function):
|
|
71 |
|
72 |
|
73 |
class FusedLeakyReLU(nn.Module):
|
74 |
-
def __init__(self,
|
75 |
super().__init__()
|
76 |
|
77 |
-
self.bias = nn.Parameter(torch.zeros(channel))
|
78 |
self.negative_slope = negative_slope
|
79 |
self.scale = scale
|
80 |
|
@@ -82,6 +81,6 @@ class FusedLeakyReLU(nn.Module):
|
|
82 |
return fused_leaky_relu(input, self.bias, self.negative_slope, self.scale)
|
83 |
|
84 |
|
85 |
-
def fused_leaky_relu(input):
|
86 |
-
return FusedLeakyReLU.apply(input)
|
87 |
|
|
|
71 |
|
72 |
|
73 |
class FusedLeakyReLU(nn.Module):
|
74 |
+
def __init__(self, negative_slope=0.2, scale=2 ** 0.5):
|
75 |
super().__init__()
|
76 |
|
|
|
77 |
self.negative_slope = negative_slope
|
78 |
self.scale = scale
|
79 |
|
|
|
81 |
return fused_leaky_relu(input, self.bias, self.negative_slope, self.scale)
|
82 |
|
83 |
|
84 |
+
def fused_leaky_relu(input, bias):
|
85 |
+
return FusedLeakyReLU.apply(input, bias)
|
86 |
|