class_docstr: This class defines the `ByteFormer <https://arxiv.org/pdf/2306.00238.pdf>`_
  architecture.
class_docstr_tok: ["This","class","defines","the","`","ByteFormer","<","https",":","\/\/arxiv.org\/pdf\/2306.00238.pdf",">","`","_","architecture","."]
docstr: Get the module that performs downsampling after transformer layer @idx.
  If no downsampling occurs after that layer, return None.
  
  Args:
      idx: The desired index.
  
  Returns:
      The downsampling layer, or None.
docstr_tok: ["Get","the","module","that","performs","downsampling","after","transformer","layer","@","idx",".","If","no","downsampling","occurs","after","that","layer",",","return","None",".","Args",":","idx",":","The","desired","index",".","Returns",":","The","downsampling","layer",",","or","None","."]
code: def get_downsampler(self, idx: int) -> Optional[nn.Module]:
      """
      Get the module that performs downsampling after transformer layer @idx.
      If no downsampling occurs after that layer, return None.
  
      Args:
          idx: The desired index.
  
      Returns:
          The downsampling layer, or None.
      """
      name = self.get_downsampler_name(idx)
      if name not in self.downsamplers:
          return None
      return self.downsamplers[name]
  
imports: import argparse
  import math
  from typing import Dict, Optional, Tuple, Union
  import numpy
  import torch
  from torch import Tensor, nn
  from torch.nn import init
  from cvnets.layers import LinearLayer, embedding, get_normalization_layer, normalization, positional_embedding, token_merging
  from cvnets.models import MODEL_REGISTRY, BaseAnyNNModel
  from cvnets.models.classification.config.byteformer import get_configuration
  from cvnets.modules import WindowedTransformerEncoder
label_desc: Use image node_id 8 for calling the ByteFormer obj's underlying member method code with example usage: obj.get_downsampler(idx) and returns: self, None