class_docstr: Beam search for language/decoder only models
class_docstr_tok: ["Beam","search","for","language\/decoder","only","models"]
code: def advance(self, log_probs, attn):
      super(BeamSearchLM, self).advance(log_probs, attn)
  
      # in LM task src_len is associated with currently generated src
      # and therefore needs to follow the generation
      self.src_len += 1
  
imports: import torch
  from onmt.translate import penalties
  from onmt.translate.decode_strategy import DecodeStrategy
  import warnings
label_desc: Use image node_id 2 for calling the BeamSearchLM obj's underlying member method code with example usage: obj.advance(log_probs, attn) without return types