feng2022 commited on
Commit
c09f77e
1 Parent(s): 6daddb5

Update Time_TravelRephotography/torch_utils/ops/bias_act.py

Browse files
Time_TravelRephotography/torch_utils/ops/bias_act.py CHANGED
@@ -91,12 +91,12 @@ def bias_act(x, b=None, dim=1, act='linear', alpha=None, gain=None, clamp=None,
91
  class bias_act_relu(nn.Module):
92
  def __init__(self, dim, negative_slope=0.2, scale=2 ** 0.5):
93
  super().__init__()
94
- self.bias = nn.Parameter(torch.zeros(dim))
95
  self.negative_slope = negative_slope
96
  self.scale = scale
97
 
98
  def forward(self, input):
99
- return bias_act(input, b=self.bias, self.negative_slope, self.scale)
100
  #----------------------------------------------------------------------------
101
 
102
  def _bias_act_ref(x, b=None, dim=1, act='linear', alpha=None, gain=None, clamp=None):
 
91
  class bias_act_relu(nn.Module):
92
  def __init__(self, dim, negative_slope=0.2, scale=2 ** 0.5):
93
  super().__init__()
94
+ self.dim = nn.Parameter(torch.zeros(dim))
95
  self.negative_slope = negative_slope
96
  self.scale = scale
97
 
98
  def forward(self, input):
99
+ return bias_act(input, b=self.bias, alpha=self.negative_slope, gain=self.scale)
100
  #----------------------------------------------------------------------------
101
 
102
  def _bias_act_ref(x, b=None, dim=1, act='linear', alpha=None, gain=None, clamp=None):