class_docstr: Decoder module
  
  :param int eprojs: encoder projection units
  :param int odim: dimension of outputs
  :param str dtype: gru or lstm
  :param int dlayers: decoder layers
  :param int dunits: decoder units
  :param int sos: start of sequence symbol id
  :param int eos: end of sequence symbol id
  :param torch.nn.Module att: attention module
  :param int verbose: verbose level
  :param list char_list: list of character strings
  :param ndarray labeldist: distribution of label smoothing
  :param float lsm_weight: label smoothing weight
  :param float sampling_probability: scheduled sampling probability
  :param float dropout: dropout rate
  :param float context_residual: if True, use context vector for token generation
  :param float replace_sos: use for multilingual (speech/text) translation
class_docstr_tok: ["Decoder","module",":","param","int","eprojs",":","encoder","projection","units",":","param","int","odim",":","dimension","of","outputs",":","param","str","dtype",":","gru","or","lstm",":","param","int","dlayers",":","decoder","layers",":","param","int","dunits",":","decoder","units",":","param","int","sos",":","start","of","sequence","symbol","id",":","param","int","eos",":","end","of","sequence","symbol","id",":","param","torch.nn.Module","att",":","attention","module",":","param","int","verbose",":","verbose","level",":","param","list","char_list",":","list","of","character","strings",":","param","ndarray","labeldist",":","distribution","of","label","smoothing",":","param","float","lsm_weight",":","label","smoothing","weight",":","param","float","sampling_probability",":","scheduled","sampling","probability",":","param","float","dropout",":","dropout","rate",":","param","float","context_residual",":","if","True",",","use","context","vector","for","token","generation",":","param","float","replace_sos",":","use","for","multilingual","(","speech\/text",")","translation"]
code: def score(self, yseq, state, x):
      # to support mutiple encoder asr mode, in single encoder mode,
      # convert torch.Tensor to List of torch.Tensor
      if self.num_encs == 1:
          x = [x]
  
      att_idx, z_list, c_list = state["workspace"]
      vy = yseq[-1].unsqueeze(0)
      ey = self.dropout_emb(self.embed(vy))  # utt list (1) x zdim
      if self.num_encs == 1:
          att_c, att_w = self.att[att_idx](
              x[0].unsqueeze(0),
              [x[0].size(0)],
              self.dropout_dec[0](state["z_prev"][0]),
              state["a_prev"],
          )
      else:
          att_w = [None] * (self.num_encs + 1)  # atts + han
          att_c_list = [None] * (self.num_encs)  # atts
          for idx in range(self.num_encs):
              att_c_list[idx], att_w[idx] = self.att[idx](
                  x[idx].unsqueeze(0),
                  [x[idx].size(0)],
                  self.dropout_dec[0](state["z_prev"][0]),
                  state["a_prev"][idx],
              )
          h_han = torch.stack(att_c_list, dim=1)
          att_c, att_w[self.num_encs] = self.att[self.num_encs](
              h_han,
              [self.num_encs],
              self.dropout_dec[0](state["z_prev"][0]),
              state["a_prev"][self.num_encs],
          )
      ey = torch.cat((ey, att_c), dim=1)  # utt(1) x (zdim + hdim)
      z_list, c_list = self.rnn_forward(
          ey, z_list, c_list, state["z_prev"], state["c_prev"]
      )
      if self.context_residual:
          logits = self.output(
              torch.cat(
                  (self.dropout_dec[-1](z_list[-1]), att_c), dim=-1
              )
          )
      else:
          logits = self.output(self.dropout_dec[-1](z_list[-1]))
      logp = F.log_softmax(logits, dim=1).squeeze(0)
      return (
          logp,
          dict(
              c_prev=c_list[:],
              z_prev=z_list[:],
              a_prev=att_w,
              workspace=(att_idx, z_list, c_list),
          ),
      )
  
imports: import logging
  import math
  import random
  from argparse import Namespace
  import numpy
  import torch
  import torch.nn.functional
  from espnet.nets.ctc_prefix_score import CTCPrefixScore, CTCPrefixScoreTH
  from espnet.nets.e2e_asr_common import end_detect
  from espnet.nets.pytorch_backend.nets_utils import mask_by_length, pad_list, th_accuracy, to_device
  from espnet.nets.pytorch_backend.rnn.attentions import att_to_numpy
  from espnet.nets.scorer_interface import ScorerInterface
label_desc: Use image node_id 13 for calling the Decoder obj's underlying member method code with example usage: obj.score(yseq, state, x) and returns: logp,  dict