Skip to content

Commit

Permalink
Merge pull request #897 from hongbozheng/patch-1
Browse files Browse the repository at this point in the history
Corrected forward operations order
  • Loading branch information
Geeks-Sid authored Jul 13, 2024
2 parents 4f9dfd7 + 2cb0ac0 commit 00c65bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions GANDLF/models/seg_modules/DownsamplingModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(
if act_kwargs is None:
act_kwargs = {"negative_slope": 1e-2, "inplace": True}

self.in_0 = norm(output_channels, **norm_kwargs)
self.in_0 = norm(input_channels, **norm_kwargs)

self.conv0 = conv(input_channels, output_channels, **conv_kwargs)

Expand All @@ -49,14 +49,14 @@ def forward(self, x):
"""
Applies a downsampling operation to the input tensor.
[input -- > in --> lrelu --> ConvDS --> output]
[input --> in --> lrelu --> ConvDS --> output]
Args:
x (torch.Tensor): Input tensor of shape (batch_size, channels, height, width)
Returns:
torch.Tensor: The output tensor, of shape (batch_size, output_channels, height // 2, width // 2).
"""
x = self.act(self.in_0(self.conv0(x)))
x = self.conv0(self.act(self.in_0(x)))

return x

0 comments on commit 00c65bd

Please sign in to comment.