Hi, guys. When I put the conditional statement in forward function, it will throw an error. Need some help. Thanks.
 284 class Pooling(nn.Module):
 285     r"""Pooling
 286     """
 287     def __init__(self):
 288         super(Pooling, self).__init__()
 289         self.fp1 = nn.FractionalMaxPool2d(kernel_size=3, output_size=(50, 80))
 290         self.fp2 = nn.FractionalMaxPool2d(kernel_size=3, output_size=(80, 50))
 291         self.fp3 = nn.FractionalMaxPool2d(kernel_size=3, output_size=(50, 50))
 292
 293     def forward(self, x):
 294         B, C, H, W = x.size()
 295
 296         if H < W:
 297             return self.fp1(x)
 298         elif H > W:
 299             return self.fp2(x)
 300         else:
 301             return self.fp3(x)