code: def set_requires_grad(self, state: bool):
      for param in chain(self.parameters(), self.buffers()):
          param.requires_grad = state
  
imports: from typing import Sequence
  from itertools import chain
  import torch
  import torch.nn
  from torchvision import models
  from .utils import normalize_activation
label_desc: Use image node_id 2 for calling the BaseNet obj's underlying member method code with example usage: obj.set_requires_grad(state) without return types