Hi,
Yes, you are managing it correctly. Just for clarification, this is the two last layer of the model:
(avgpool): AdaptiveAvgPool3d(output_size=(1, 1, 1))
(fc): Linear(in_features=512, out_features=400, bias=True)

So by your code it will be converted to:
(avgpool): AdaptiveAvgPool3d(output_size=(1, 1, 1))
(fc): Sequential(
    (0): Dropout(p=0.5, inplace=False)
    (1): Linear(in_features=512, out_features=#num_classes, bias=True)
  )

Bests