class_docstr: Transformer encoder of Deformable DETR.
docstr: Initialize encoder layers.
docstr_tok: ["Initialize","encoder","layers","."]
code: def _init_layers(self) -> None:
      """Initialize encoder layers."""
      self.layers = ModuleList(
          [
              DeformableDetrTransformerEncoderLayer(**self.layer_cfg)
              for _ in range(self.num_layers)
          ]
      )
  
      if self.num_cp > 0:
          if checkpoint_wrapper is None:
              raise NotImplementedError(
                  "If you want to reduce GPU memory usage, \
                      please install fairscale by executing the \
                      following command: pip install fairscale."
              )
          for i in range(self.num_cp):
              self.layers[i] = checkpoint_wrapper(self.layers[i])
  
      self.embed_dims = self.layers[0].embed_dims
  
imports: from typing import Optional, Tuple, Union
  import torch
  from mmcv.cnn import build_norm_layer
  from mmcv.cnn.bricks.transformer import FFN, MultiheadAttention
  from mmcv.ops import MultiScaleDeformableAttention
  from mmengine.model import ModuleList
  from torch import Tensor, nn
  from .detr_layers import DetrTransformerDecoder, DetrTransformerDecoderLayer, DetrTransformerEncoder, DetrTransformerEncoderLayer
  from .utils import inverse_sigmoid
label_desc: Use image node_id 1 for calling the DeformableDetrTransformerEncoder obj's underlying member method code with example usage: obj._init_layers() without return types