I want to add drop out layer before final layer of pretrained resnet3D model, can someone please verify my approach, am I doing it correctly?
model = torchvision.models.video.r3d_18(pretrained=True)
model.fc = nn.Sequential(
     nn.Dropout(0.5),
     nn.Linear(model.fc.in_features, num_classes)
)

Thankyou.