class_docstr: VGG + Transformer encoder
class_docstr_tok: ["VGG","+","Transformer","encoder"]
docstr: parsing transformer sampling configuration
  
  Args:
      - transformer_sampling, accepted input:
          * None, indicating no sampling
          * an Iterable with int (>0) as element
      - num_layers, expected number of transformer layers, must match with
        the length of transformer_sampling if it is not None
  
  Returns:
      - A tuple with length num_layers
docstr_tok: ["parsing","transformer","sampling","configuration","Args",":","-","transformer_sampling",",","accepted","input",":","*","None",",","indicating","no","sampling","*","an","Iterable","with","int","(",">","0",")","as","element","-","num_layers",",","expected","number","of","transformer","layers",",","must","match","with","the","length","of","transformer_sampling","if","it","is","not","None","Returns",":","-","A","tuple","with","length","num_layers"]
code: def parse_transformer_sampling(
      self, transformer_sampling, num_layers
  ):
      """
      parsing transformer sampling configuration
  
      Args:
          - transformer_sampling, accepted input:
              * None, indicating no sampling
              * an Iterable with int (>0) as element
          - num_layers, expected number of transformer layers, must match with
            the length of transformer_sampling if it is not None
  
      Returns:
          - A tuple with length num_layers
      """
      if transformer_sampling is None:
          return (1,) * num_layers
  
      if not isinstance(transformer_sampling, Iterable):
          raise ValueError(
              "transformer_sampling must be an iterable if it is not None"
          )
  
      if len(transformer_sampling) != num_layers:
          raise ValueError(
              "transformer_sampling {} does not match with the number "
              "of layers {}".format(transformer_sampling, num_layers)
          )
  
      for layer, value in enumerate(transformer_sampling):
          if not isinstance(value, int):
              raise ValueError(
                  "Invalid value in transformer_sampling: "
              )
          if value < 1:
              raise ValueError(
                  "{} layer's subsampling is {}.".format(layer, value)
                  + " This is not allowed! "
              )
      return transformer_sampling
  
imports: import argparse
  import math
  from collections.abc import Iterable
  import torch
  import torch.nn
  from examples.speech_recognition.data.data_utils import lengths_to_encoder_padding_mask
  from fairseq import utils
  from fairseq.models import FairseqEncoder, FairseqEncoderDecoderModel, FairseqEncoderModel, FairseqIncrementalDecoder, register_model, register_model_architecture
  from fairseq.modules import LinearizedConvolution, TransformerDecoderLayer, TransformerEncoderLayer, VGGBlock
label_desc: Use image node_id 6 for calling the VGGTransformerEncoder obj's underlying member method code with example usage: obj.parse_transformer_sampling(transformer_sampling, num_layers) and returns: transformer_sampling, unknown