code: def set_requires_grad(nets, requires_grad=False):
      """Set requies_grad=Fasle for all the networks to avoid unnecessary
      computations
      Parameters:
          nets (network list)   -- a list of networks
          requires_grad (bool)  -- whether the networks require gradients or not
      """
      if not isinstance(nets, list):
          nets = [nets]
      for net in nets:
          if net is not None:
              for param in net.parameters():
                  param.requires_grad = requires_grad
  
file_path: fairseq/examples/speech_synthesis/preprocessing/speaker_embedder/__init__.py
imports: import librosa
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.utils.data
  import torchaudio
label_desc: Use image node_id 1 for calling a global function with example usage: set_requires_grad(nets, requires_grad) without return types