class_docstr: Discrete unit Synthesizer related modules for speech-to-speech translation.
  
  This is a module of discrete unit prediction network in discrete-unit described
  in `Direct speech-to-speech translation with discrete units`_,
  which converts the sequence of hidden states into the sequence of
  discrete unit (from SSLs).
  
  .. _`Direct speech-to-speech translation with discrete units`:
     https://arxiv.org/abs/2107.05604
docstr: Score.
docstr_tok: ["Score","."]
code: def score(self, ys, state, x):
      """Score."""
      ys_mask = subsequent_mask(len(ys), device=x.device).unsqueeze(0)
      logp, state = self.forward_one_step(
          ys.unsqueeze(0), ys_mask, x.unsqueeze(0), cache=state
      )
      return logp.squeeze(0), state
  
imports: import logging
  from typing import Any, Dict, List, Optional, Sequence, Tuple
  import torch
  import torch.nn.functional
  from typeguard import check_argument_types
  from espnet2.asr.decoder.transformer_decoder import TransformerDecoder
  from espnet2.s2st.synthesizer.abs_synthesizer import AbsSynthesizer
  from espnet2.torch_utils.device_funcs import force_gatherable
  from espnet.nets.pytorch_backend.transformer.embedding import PositionalEncoding
  from espnet.nets.pytorch_backend.transformer.mask import subsequent_mask
  from espnet.nets.scorer_interface import BatchScorerInterface
label_desc: Use image node_id 6 for calling the TransformerDiscreteSynthesizer obj's underlying member method code with example usage: obj.score(ys, state, x) and returns: logp,  state