class_docstr: VGG + Transformer encoder
class_docstr_tok: ["VGG","+","Transformer","encoder"]
docstr: transformer_context can be the following:
  -   None; indicates no context is used, i.e.,
      transformer can access full context
  -   a tuple/list of two int; indicates left and right context,
      any number <0 indicates infinite context
          * e.g., (5, 6) indicates that for query at x_t, transformer can
          access [t-5, t+6] (inclusive)
          * e.g., (-1, 6) indicates that for query at x_t, transformer can
          access [0, t+6] (inclusive)
docstr_tok: ["transformer_context","can","be","the","following",":","-","None",";","indicates","no","context","is","used",",","i.e.",",","transformer","can","access","full","context","-","a","tuple\/list","of","two","int",";","indicates","left","and","right","context",",","any","number","<","0","indicates","infinite","context","*","e.g.",",","(","5",",","6",")","indicates","that","for","query","at","x_t",",","transformer","can","access","[","t-5",",","t+6","]","(","inclusive",")","*","e.g.",",","(","-1",",","6",")","indicates","that","for","query","at","x_t",",","transformer","can","access","[","0",",","t+6","]","(","inclusive",")"]
code: def parse_transformer_context(self, transformer_context):
      """
      transformer_context can be the following:
      -   None; indicates no context is used, i.e.,
          transformer can access full context
      -   a tuple/list of two int; indicates left and right context,
          any number <0 indicates infinite context
              * e.g., (5, 6) indicates that for query at x_t, transformer can
              access [t-5, t+6] (inclusive)
              * e.g., (-1, 6) indicates that for query at x_t, transformer can
              access [0, t+6] (inclusive)
      """
      if transformer_context is None:
          return None
  
      if not isinstance(transformer_context, Iterable):
          raise ValueError(
              "transformer context must be Iterable if it is not None"
          )
  
      if len(transformer_context) != 2:
          raise ValueError("transformer context must have length 2")
  
      left_context = transformer_context[0]
      if left_context < 0:
          left_context = None
  
      right_context = transformer_context[1]
      if right_context < 0:
          right_context = None
  
      if left_context is None and right_context is None:
          return None
  
      return (left_context, right_context)
  
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 5 for calling the VGGTransformerEncoder obj's underlying member method code with example usage: obj.parse_transformer_context(transformer_context) and returns: left_context,  right_context, None, None