code: def forward(
      self,
      src_tokens,
      incremental_state: Optional[Dict[str, List[torch.Tensor]]] = None,
      encoder_out=None,
  ):
      bsz = src_tokens.size(0)
      if incremental_state is not None:  # used during inference
          mems = self.get_incremental_state("mems")
          src_tokens = src_tokens[
              :, -1:
          ]  # only keep the most recent token
      else:
          mems = self._mems
  
      if mems is None:
          # first time init
          mems = self.init_hid_cache(bsz)
      output = self.model(
          x=src_tokens,
          h_cache=mems,
      )
      if incremental_state is not None:
          self.set_incremental_state(
              incremental_state, "mems", output[1]
          )
      else:
          self._mems = output[1]
      return (output[0],)
  
imports: import logging
  from dataclasses import dataclass
  from typing import Dict, List, Optional
  import torch
  from fairseq.dataclass import FairseqDataclass
  from fairseq.models import FairseqIncrementalDecoder, FairseqLanguageModel, register_model
  from .adaptive_span_model import TransformerSeq
label_desc: Use image node_id 2 for calling the AdaptiveSpanDecoder obj's underlying member method code with example usage: obj.forward(src_tokens, incremental_state, encoder_out) and returns: output