Describe the bug
The ResNet class has a parameter feed_forward which allows skipping of the final dense layer if I intepret that correctly. A respective layer is only created if the parameter is set to True (see here) but in the forward pass, there is no query for whether the layer actually exists see here.
To Reproduce
import torch
from monai.networks.nets.resnet import resnet50
x = torch.ones((1, 1, 64, 64, 64))
model_monai = resnet50(spatial_dims=x.ndim-2, n_input_channels=x.shape[1], feed_forward=False)
print(model_monai)
# throws an error
y = model_monai(x)
Expected behavior
The ResNet class should not throw an error if feed_forward=False.
Describe the bug
The ResNet class has a parameter
feed_forwardwhich allows skipping of the final dense layer if I intepret that correctly. A respective layer is only created if the parameter is set to True (see here) but in the forward pass, there is no query for whether the layer actually exists see here.To Reproduce
Expected behavior
The ResNet class should not throw an error if
feed_forward=False.