docstr: Freeze weights of embedding, decoder, and classification layers to prevent memory leak.
          
docstr_tok: ["Freeze","weights","of","embedding",",","decoder",",","and","classification","layers","to","prevent","memory","leak","."]
code: def freeze(self) -> None:
      """Freeze weights of embedding, decoder, and classification layers to prevent memory leak."""
      for model_num in range(self.num_models):
          for param in self.embeddings[model_num].parameters():
              param.requires_grad = False
          self.embeddings[model_num].eval()
          for param in self.decoders[model_num].parameters():
              param.requires_grad = False
          self.decoders[model_num].eval()
          for param in self.log_softmaxes[model_num].parameters():
              param.requires_grad = False
          self.log_softmaxes[model_num].eval()
          for param in self.encoders[model_num].parameters():
              param.requires_grad = False
          self.encoders[model_num].eval()
  
imports: from contextlib import contextmanager
  import torch
  from nemo.collections.common.parts import NEG_INF, mask_padded_tokens
label_desc: Use image node_id 10 for calling the EnsembleBeamSearchSequenceGenerator obj's underlying member method code with example usage: obj.freeze() without return types