I assume you don’t want the auto-encoder to be trained together with the classifier.
Then you freeze its layers using:
# disable gradients (prevent training)
for p in autoencoder.parameters():  # reset requires_grad
    p.requires_grad = False

and additionally, set it to eval mode using
autoencoder.eval()

.eval() puts batch norm to inference mode, disables dropout etc.
If you leave the autoencoder in train mode it will still have the momentum from the batchnorm (from the last couple training steps) and dropout and usually, you don’t want this.