Skip to content

Commit

Permalink
Revert "Autofix format errors"
Browse files Browse the repository at this point in the history
This reverts commit 45f0b26.
  • Loading branch information
yiheng-wang-nv committed Aug 4, 2020
1 parent 45f0b26 commit a0981cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
4 changes: 1 addition & 3 deletions monai/networks/blocks/fcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,7 @@ def forward(self, x: torch.Tensor):
fs4 = self.refine9(F.interpolate(fs3, conv_x.size()[2:], mode="bilinear", align_corners=True) + gcfm5)
out = self.refine10(F.interpolate(fs4, org_input.size()[2:], mode="bilinear", align_corners=True))
else:
raise NotImplementedError(
f"Currently only 'transpose' and 'interpolate' modes are supported, got {self.upsample_mode}."
)
raise NotImplementedError(f"Currently only 'transpose' and 'interpolate' modes are supported, got {self.upsample_mode}.")
return out


Expand Down
16 changes: 4 additions & 12 deletions monai/networks/nets/ahnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ def __init__(self, num_input_features: int, num_output_features: int, upsample_m
elif upsample_mode == "interpolate":
self.add_module("pool", nn.Upsample(scale_factor=2, mode="trilinear", align_corners=True))
else:
raise NotImplementedError(
f"Currently only 'transpose' and 'interpolate' modes are supported, got {upsample_mode}."
)
raise NotImplementedError(f"Currently only 'transpose' and 'interpolate' modes are supported, got {upsample_mode}.")


class Final(nn.Sequential):
Expand All @@ -145,9 +143,7 @@ def __init__(self, num_input_features: int, num_output_features: int, upsample_m
elif upsample_mode == "interpolate":
self.add_module("up", nn.Upsample(scale_factor=2, mode="trilinear", align_corners=True))
else:
raise NotImplementedError(
f"Currently only 'transpose' and 'interpolate' modes are supported, got {upsample_mode}."
)
raise NotImplementedError(f"Currently only 'transpose' and 'interpolate' modes are supported, got {upsample_mode}.")


class Pseudo3DLayer(nn.Module):
Expand Down Expand Up @@ -260,9 +256,7 @@ def forward(self, x):
self.proj8(self.pool8(x)), size=(x.size(2), x.size(3), x.size(4)), mode="trilinear", align_corners=True
)
else:
raise NotImplementedError(
f"Currently only 'transpose' and 'interpolate' modes are supported, got {self.upsample_mode}."
)
raise NotImplementedError(f"Currently only 'transpose' and 'interpolate' modes are supported, got {self.upsample_mode}.")
x = torch.cat((x64, x32, x16, x8), dim=1)
return x

Expand Down Expand Up @@ -312,9 +306,7 @@ def __init__(self, layers: tuple = (3, 4, 6, 3), upsample_mode: str = "transpose
elif upsample_mode == "interpolate":
self.maxpool = pool3d_type(kernel_size=(3, 3, 3), stride=2, padding=1)
else:
raise NotImplementedError(
f"Currently only 'transpose' and 'interpolate' modes are supported, got {upsample_mode}."
)
raise NotImplementedError(f"Currently only 'transpose' and 'interpolate' modes are supported, got {upsample_mode}.")

self.layer1 = self._make_layer(Bottleneck3x3x1, 64, layers[0], stride=1)
self.layer2 = self._make_layer(Bottleneck3x3x1, 128, layers[1], stride=2)
Expand Down

0 comments on commit a0981cd

Please sign in to comment.