class_docstr: Adds adapters to the BartModel class.
code: def iter_layers(self) -> Iterable[Tuple[int, nn.Module]]:
      if hasattr(self, "encoder"):
          for i, layer in enumerate(self.encoder.layers):
              yield i, layer
          for i, layer in enumerate(
              self.decoder.layers, start=len(self.encoder.layers)
          ):
              yield i, layer
      else:
          for i, layer in enumerate(self.decoder.layers):
              yield i, layer
  
imports: from typing import Iterable, Optional, Tuple
  import torch
  import torch.nn
  from ...composition import adjust_tensors_for_parallel
  from ...methods.bottleneck import BottleneckLayer
  from ...methods.lora import LoRALinear
  from ...methods.prefix_tuning import PrefixTuningLayer
  from ...model_mixin import EmbeddingAdaptersMixin, EmbeddingAdaptersWrapperMixin, InvertibleAdaptersMixin, InvertibleAdaptersWrapperMixin, ModelBaseAdaptersMixin
label_desc: Use image node_id 2 for calling the BartModelAdaptersMixin obj's underlying member method code with example usage: obj.iter_layers() without return types