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: Forward one step.
  
  Args:
      tgt: input token ids, int64 (batch, maxlen_out)
      tgt_mask: input token mask,  (batch, maxlen_out)
                dtype=torch.uint8 in PyTorch 1.2-
                dtype=torch.bool in PyTorch 1.2+ (include 1.2)
      memory: encoded memory, float32  (batch, maxlen_in, feat)
      cache: cached output list of (batch, max_time_out-1, size)
  Returns:
      y, cache: NN output value and cache per `self.decoders`.
      y.shape` is (batch, maxlen_out, token)
docstr_tok: ["Forward","one","step",".","Args",":","tgt",":","input","token","ids",",","int64","(","batch",",","maxlen_out",")","tgt_mask",":","input","token","mask",",","(","batch",",","maxlen_out",")","dtype=torch.uint8","in","PyTorch","1.2-","dtype=torch.bool","in","PyTorch","1.2+","(","include","1.2",")","memory",":","encoded","memory",",","float32","(","batch",",","maxlen_in",",","feat",")","cache",":","cached","output","list","of","(","batch",",","max_time_out-1",",","size",")","Returns",":","y",",","cache",":","NN","output","value","and","cache","per","`","self.decoders","`",".","y.shape","`","is","(","batch",",","maxlen_out",",","token",")"]
code: def forward_one_step(
      self,
      tgt: torch.Tensor,
      tgt_mask: torch.Tensor,
      memory: torch.Tensor,
      cache: List[torch.Tensor] = None,
  ) -> Tuple[torch.Tensor, List[torch.Tensor]]:
      """Forward one step.
  
      Args:
          tgt: input token ids, int64 (batch, maxlen_out)
          tgt_mask: input token mask,  (batch, maxlen_out)
                    dtype=torch.uint8 in PyTorch 1.2-
                    dtype=torch.bool in PyTorch 1.2+ (include 1.2)
          memory: encoded memory, float32  (batch, maxlen_in, feat)
          cache: cached output list of (batch, max_time_out-1, size)
      Returns:
          y, cache: NN output value and cache per `self.decoders`.
          y.shape` is (batch, maxlen_out, token)
      """
      # FIXME(jiatong): the spk/lang embedding may be execute too many times
      # consider add before the search
      if self.spks is not None:
          sid_embs = self.sid_emb(sids.view(-1))
          memory = memory + sid_embs.unsqueeze(1)
      if self.langs is not None:
          lid_embs = self.lid_emb(lids.view(-1))
          memory = memory + lid_embs.unsqueeze(1)
      if self.spk_embed_dim is not None:
          memory = self._integrate_with_spk_embed(memory, spembs)
  
      return self.decoder.forward_one_step(tgt, tgt_mask, memory, cache)
  
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 5 for calling the TransformerDiscreteSynthesizer obj's underlying member method code with example usage: obj.forward_one_step(tgt, tgt_mask, memory, cache) and returns: self